23480 Posts in 18951 Topics by 2878 members
|Go to End|
28 March 2011 at 8:51pm Last edited: 28 March 2011 9:13pm
i have added an image in the model:
public static $has_one = array(
"Photo" => "Image"
how can i access it from controller?
when i callin controller, i can see the reference to the photo in the listing, but i can't find a way to access it.
when i tryi get an undefined.
but accessing any other custom entry from static db array
public static $db = array(
"Abstract" => "Text",
"Phone1" => "Text",
"Phone2" => "Text"
so, is there a way to access $Photo?
30 March 2011 at 12:01am
You need to use the method syntax for accessing relationships like that - $this->Photo(); to get the image record.
1 April 2011 at 7:11am
thanks! i still sometimes fight with php...
|Go to Top|