Hi winter,
If you have a field called 'name' or 'title' in the Item table (which
I'm guessing is the case from the schema you gave above), try using:
$items = $this->Item->find('list');
$this->set(compact('items'));.
If your field isn't called 'name' or 'title', then you can set the
$displayField variable in the Item model for whatever field name you
use to identify the items. This should be enough for cake to
automagically populate the form input on your view pages (if you are
using the form helper, of course).
-Joel.
On Jun 5, 11:41 pm, winter <[EMAIL PROTECTED]> wrote:
> Thanks Chris. I read your reply and went over it again this morning
> and managed to get that association to work. The bit that is still
> stumping me is the html select. I still can't do: $this->set('items',
> $this->Item->findAll()); in my add() function in units_controller.php.
> I want to pass all the items to the add view and have them populate an
> html select. Perhaps there is a built-in cake method for doing this.
> Am I going about it wrong? Thanks for your help. It's much appreciated.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---