I’m using CakePHP 2.0. Is it possible to display multiple fields in select/dropdown box without using virtualFields?
Right now I have this:
$this->set('venues', $this->Game->Venue->find('list', array('fields' => array('id', 'name', 'town'))));
The problem is that when two fields are equal (in this case name and town) the selectable item won’t show in the list. In this case only the name and it can’t be selected.
Not sure why you cant make a virtual field, but you can create the field manually in the controller by just looping through the rows and making your own list.