$this->set(compact($options));

On Wed, Jul 28, 2010 at 4:29 PM, hoss7 <[email protected]> wrote:
> i am test you code @circket but i have error:
>
> Undefined variable: options
>
> i use you code like this:
> in view:
> echo $form->select('category_id', $options);
>
> in SubcatsController:
> function usercat() {
>                $usercats = $this->Subcat->Cat->find('all');
>
>                $options = array();
> foreach($usercats as $k => $v)
> {
>        $cat_name = $v['Cat']['title'];
>
>        $options[$cat_name] = array();
>
>        foreach($v['Subcat'] as $sub_cat)
>        {
>                $options[$cat_name][$sub_cat['id']] =
> $sub_cat['title'];
>        }
>
> }
>
> please read my new information i post befor this post
>
> 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