How to retrieve data from another model into view templates or anyplace

How to retrieve data from another model into view templates or anyplace

To retrieve data from another model into view templates or anyplace

$this->Model2 = ClassRegistry::init('Model2 ');
$this->Model2 ->find();

Or if the models are associated, just daisy chain the finds:

$results = $this->Model1->Model2->find();

Pin It on Pinterest

Share This