> I've swicthed back to the htmltag form, and can get my select box to
> display but not correctly. it just gets filled with .$user.
>
> Heres the code:
>
> <?php echo $html->selectTag('users', array(' . $user . ' => ' .$user .
> '), null, array(), array(), true, false); ?>
>
> If I change array(' . $user . ' => ' .$user . ') to $user the select
> box gets populated with the correct number of users but not the
> values, just "array". So I'm assuming I'm not applying the index of
> the array correctly, how can I do this, there isn't an example in the
> api.
You need to use $this->Model->generateList() to get the correct array
to pass to the selectTag method.
// controller
$this->set('users', $this->User->generateList());
// view
echo $html->selectTag('User/User', $users);
Read the explanation of Model->generateList() on the manual
http://manual.cakephp.org/chapter/models
hth
Jon
--
jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---