The find('list') returns an array containing the id and displayField
(ie. a field named "title" or "name") for the model.

Use pr() to see the structure it creates

$people = $this->Work->Person->find('list);
pr($people);

Then in your baked view you should see something like this.

echo $form->input('Person');

or it could be:

echo $form->input('person_id');

This will create a select list populated with the contents of the
$people array passed to your view.

Hope this explanation has been helpful.

Cheers,
Adam


On Feb 15, 4:38 pm, "sixs" <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm using BAKE and I get some code that refers to list.
> ================================================
>  function add() {
>   if (!empty($this->data)) {
>    $this->Work->create();
>    if ($this->Work->save($this->data)) {
>     $this->Session->setFlash(__('The Work has been saved', true));
>     $this->redirect(array('action'=>'index'));
>    } else {
>     $this->Session->setFlash(__('The Work could not be saved. Please, try 
> again.', true));
>    }
>   }
>   $people = $this->Work->Person->find('list);
>   $this->set(compact('people'));
> =============================================
> What is the list that this line refers to in the find???????
>  $people = $this->Work->Person->find('list);
>                                                          ^^^
>
> Jim
> Thanks for any help!!!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to