OK, but I work on a multilingual projekt and need the name of the
outgroup translated, so I need to use __() function.
I have my array ready, but right now the 'group key' is numeric key
and I don't know how to replace this numeric key with a string (which
I can translate)

On 27 Feb., 14:17, Thiago Belem <cont...@thiagobelem.net> wrote:
> http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormH...
>
> Always check the documentation...
>
> If you would like to generate a select with optgroups, just pass data in
> hierarchical format. This works on multiple checkboxes and radio buttons
> too, but instead of optgroups wraps elements in fieldsets:
>
> <?php
> $options = array(
>   'Group 1' => array(
>     'Value 1' => 'Label 1',
>     'Value 2' => 'Label 2'
>   ),
>   'Group 2' => array(
>     'Value 3' => 'Label 3'
>   )
> );
> echo $this->Form->select('field', $options);

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to