Hi everyone,
My Self Joined Categories table is as follows:
id, name, description, parent_id
I used Cake Bake to generate the Model, Controller and Views. Model has the $belongsTo and $hasMany association set up. In add() of the controller,
$parentCategories = $this->Category->ParentCategory->find('list');
$this->set(compact('parentCategories'));
is present. In the add view, the cake bake generated form is:
<?php
echo $this->Form->input('name');
echo $this->Form->input('description');
echo $this->Form->input('isincome');
echo $this->Form->input('parent_id');
?>
When I run in browser, the parent_id field is getting a drop down, but it is not being filled with any data. I used
<?debug($parentCategories);?>
in the add view, and it happily outputs
Array
(
[1] => Entertainment
[2] => Groceries
)
But this array is not being used for filling that drop down by the Form helper. What should I do? Is this a bug with Cake's Form helper in 1.3? It never occurred in 1.2...