this helped me too !  thanks grigri

PS: If you have some time quote this simple example in http://book.cakephp.org/
, I'm too new entry to explain the example.

On Feb 11, 10:41 am, grigri <[EMAIL PROTECTED]> wrote:
> find('list') only works with simple fields, you won't be able to do
> this.
>
> Still, it's easy enough with find('all') andSet::combine():
>
> $people = $this->Person->find('all', array(
>   'fields' => array('id', 'firstname', 'insertion', 'surname'),
>   'recursive' => -1
> ));
> $list =Set::combine(
>   $people,
>   '{n}.Person.id',
>   array('%s %s %s', '{n}.Person.firstname', '{n}.Person.insertion',
> '{n}.Person.surname')
> );
>
> On Feb 11, 9:25 am, roryy <[EMAIL PROTECTED]> wrote:
>
> > Hello cakephp friends,
>
> > I have 2 tables. Communications and people. In communications/add i
> > want a list where you can choose one person from table people. But you
> > don't see his name, only his ID. I have these fields in table people:
>
> > id
> > firstname
> > insertion
> > surname
>
> > Can someone help me to make a list where you can see a persons
> > firstname, insertion and surname with find('list' , .....) in the
> > communication controller.
>
> > Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
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