CakePHP – Accessing an un-related model from a controller action

Written by James McDonald

November 14, 2011

Check point 9 here => http://nuts-and-bolts-of-cakephp.com/2008/06/09/15-essential-cakephp-tips/

This didn’t work for me:

$this->load('IgnoreList');

I got this error:
Fatal error: Call to undefined method EdiRecordsController::load()

This worked

$MyModel = ClassRegistry::init('IgnoreList');		
$ignore_list = $MyModel->find('list');

CakePHP version: 2.0.2

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Meraki Open Source Licenses

Until today I assumed that Meraki was built in-house with only closed source software. But having a look at the...

VEEAM FAILS

If you have Veeam backup failing with the Updating BCD failed with Cannot update SafeBoot flag and SentinelOne is...