Hi everyone,
How do you use $form->select with data from the model?

$select = array();

        foreach($categories as $category):
                $ucok = array($category['Category']['ID'] => 
$category['Category']
['Name']);
                array_push($select,$ucok);
        endforeach;


echo $form->select('category',$select,null,'',false);

the line above would produce this HTML code:

<select id="PostCategory" 0="0" name="data[Post][category]">
    <option value="2">JAVA</option>
     <optgroup label="1">
                  <option value="1">PHP</option>
     </optgroup>
</select>

>.< How to use $form->select properly

Thanks before...


--~--~---------~--~----~------------~-------~--~----~
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