Re: Cake 2.0 Virtual Fields

2011-12-06 Thread aries
Hey that works too, and is more elegant. Thanks for the suggestion! On Dec 5, 4:52 pm, euromark dereurom...@googlemail.com wrote: ah thats what you mean did you try setting $displayField of that model to name? that should also work On 5 Dez., 19:04, aries br...@allemana.com wrote:

Re: Cake 2.0 Virtual Fields

2011-12-05 Thread aries
Hi there, Thanks for your response. I should have clarified my situation. I have a form for a related Region model (HABTM relationship) that calls $this-Form-input('Reporter'); to show a multi select list of Reporter records. I figured that adding a virtual name field called name would

Re: Cake 2.0 Virtual Fields

2011-12-05 Thread aries
Solution: In the Regions controller, I have to specify the find fields, viz: $reporters = $this-Region-Reporter-find('list', array('fields' = array('id', 'name'))); Thanks, -Brian On Dec 5, 11:45 am, aries br...@allemana.com wrote: Hi there, Thanks for your response. I should have clarified

Re: Cake 2.0 Virtual Fields

2011-12-05 Thread euromark
ah thats what you mean did you try setting $displayField of that model to name? that should also work On 5 Dez., 19:04, aries br...@allemana.com wrote: Solution: In the Regions controller, I have to specify the find fields, viz: $reporters = $this-Region-Reporter-find('list', array('fields'

Cake 2.0 Virtual Fields

2011-12-03 Thread aries
Hello, I'm trying to use virtual fields with Cake 2.0 and am running into a problem. I'm trying to populate a select input with values from a table that has no `name` field. I'm setting a virtual field called `name` with the first_name and last_name fields, but the menu is not populating

Re: Cake 2.0 Virtual Fields

2011-12-03 Thread euromark
you might be doing sth wrong how are you processing the result? because Reporter__name is correct so far. cake will then automatically merge the content of this key back to the Model result array with the key name. and then it should be available with $result['Reporter']['name'] since name and