1
In the code below, I have a Select
, that returns all my accommodations that are with parent_id null
, which in case would be all accommodations FATHER. But when it comes time to return, I need you to show me the accommodation FATHER and their Children.
Ex.: Room - bathroom - bed - lunch.
How do I get the Children of each accommodation FATHER?
Part of the form select:
<?= $this->Form->input('acomodacao',array(
'type' => 'select',
'options' => $acomodacoes,
'class' => 'form-control',
'empty' => 'Escolha uma acomodação'
));
?>
Code that queries in the controller:
$acomodacoes = $this->Navigation->find('list',array(
'conditions' => array(
'parent_id' => null,
),
'fields' => array(
'Navigation.nome',
),
));
Do you want to simply get a "run" list of items from these parents without any grouping? Or use the
<select>
to format in a segmented way?– Paulo Rodrigues
I just want you to show on select the other Children that you’re part of Dad. Because when I save, the id that goes to the database will only be the parent id. I’ve tried with getPath, but it didn’t work..
– Math's