Actually I made a mistake, so I'm correcting me first:
In you Model you need to call $this->find instead of
$this->Property->User->find of course.
Model- and Controller Method should never ever be called from the View. The
Model got all the methods for retrieving and manipulation of an object,
Thankyou, how would I go about calling it within the properties view
foreach loop?
I tried this:
$estate_name = $this->getEstateName($property['Property']
['estate_id']);
and then I tried:
echo getEstateName($property['Property']['estate_id']);
but both times I got errors like this:
Call to un
Hi elogic,
since your methods for getting estate- and staff names are supposed to
be called more than once, I would recommend to outsource your code
into model methods, so you can easily call them from your controller
and don't have any code repitition.
/*
* @param int $accountId: The Account Id
Hi All,
I have on my view page of properties in the controller which is
working as I want it to.
// GET THE ESTATE AND STAFF NAMES
$estate_name = $this->Property->User->find('first', array('conditions'
=> array('Account.id' => $this->Property->field('estate_id')),
'fields' => array('Account.firs