I think you can't do it.
One solution:
controller:
$this->User->recursive = -1;
$users= $this->User->find('all', array('fields'=>array('User.id',
'User.FirstName', 'User.LastName')));
$users = Set::combine($users, '{n}.User.id',
array('%s %s', '{n}.User.LastName', '{n}.User.FirstName'));
$this->set('users', $users')
view:
echo $form->input('id', array('options'=>$users));
Marco
On Dec 7, 3:44 am, Mohammad Raheel <[email protected]> wrote:
> I want to use 2 Concatenated fields in $displayField variable in a
> model so that the view can show both FirstName and LastName in the
> dropdown selection.
>
> var $displayField = "firstName";
>
> I need something like
> var $displayField = "firstName"." "."lastName";
>
> The above statement is not valid in a variable declaration inside a
> class.
>
> Please advice.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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