On Apr 23, 2007, at 3:34 PM, grimborg wrote:
>
> Hi,
>
> I have a table "document" with a hasMany relation to a table "label".
> In the add view of my document I'd like to show a list of all
> available "label"s. So I code an add method in the DocumentController
> and add something like:
>
> $l = new Label();
> $l = $l->findAll();
> $this->set('labels',$l);
>
> But I get a "Class Label not found" error.
Have you created your Label model yet?
Have you added it to the controller's $uses array?
You can also access associated models via $this->Document->Label
rather than trying to create new instances manually.
-- John
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---