If your models are set up correctly, var $hasMany = array('Label'); in your
Document model, you would use the following in your DocumentsController:
$this->set('labels', $this->Document->Label->findAll());
--
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access public
*/
On 4/23/07, grimborg <[EMAIL PROTECTED]> 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.
>
> What's the right way to archieve this? I've been reading tutorials but
> found no reference to this...
>
> Thanks!
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---