Wednesday, July 28, 2010

Re: problem select menu with "optgroups"

On Tue, Jul 27, 2010 at 1:41 PM, hoss7 <hossbit@gmail.com> wrote:
>
> i want create select menu with "optgroups" like this:
>
>        <select>
>                        <optgroup label="cat1">
>                                <option value="3">sub1-1</option>
>                        </optgroup>
>                                <optgroup label="cat2">
>                                <option value="1">sub2-1</option>
>                                <option value="2">sub2-2</option>
>                        </optgroup>
>        </select>
>
> what i am must to do in view?

Pass the options array for $form->select() as:

Array
(
[cat1] => Array
(
[3] => sub1-1
)
[cat2] => Array
(
[1] => sub2-1
[2] => sub2-2
)
)

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: