In the code below, I have a Select
, which returns all my accommodations that are parent_id null
, which in this case would be all the PAI accomodations. But when it comes back, I need you to show the accommodation PAI and your children .
Eg: Bedroom - bathroom - bed - breakfast.
How do I get the children of each accommodation PAI ?
Part of form select:
<?= $this->Form->input('acomodacao',array(
'type' => 'select',
'options' => $acomodacoes,
'class' => 'form-control',
'empty' => 'Escolha uma acomodação'
));
?>
Code that queries the controller:
$acomodacoes = $this->Navigation->find('list',array(
'conditions' => array(
'parent_id' => null,
),
'fields' => array(
'Navigation.nome',
),
));