Try:
echo $this->Form->input('parent_id', array('options' => $parentCategories));

Jeremy Burns
Class Outfit

[email protected]
http://www.classoutfit.com

On 20 Aug 2010, at 06:28, ashok.b wrote:

> 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 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?
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to