In section 7.3.3 of the manual, it talks about form automagic that is
really cool and simplifies forms greatly. Specifically I'm talking
about, the example of, in the controller doing:
$this->set('groups', $this->User->Group->find('list'));
and then in the form:
echo $this->Form->input('Group');
This will create a multiselect form element assuming the table groups
has id and name fields. The select will display the contents of the
name field and the value stored in the table will be the id value for
that row in the table.
My question is: is there some similar view magic built in to CakePHP
that when I just want to display the groups that the user belongs to
(not in an edit form), that will output the contents of the name field
instead of the id field.
I know I can do the lookup myself and even put in an afterFind() or
beforeRnder() call to do the conversion automatically, but, I was
wondering if there was something built-in that I had missed? It would
probably be an HTML helper call but I can't find it.
Thanks,
Ken
--
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
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php