Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cakephp ClassRegistry::init in bootstrap

can I use a model in bootstrap.php to get an array with find() from database ?

like this :

$Setting = ClassRegistry::init('Setting');
$Settings = $Setting->find('all');

thanks

like image 804
ali786 Avatar asked Apr 12 '12 11:04

ali786


1 Answers

You need to manually load the used classes then, if you really must use core internal stuff that early.

try

App::uses('ClassRegistry', 'Utility');

before you actually use ClassRegistry.

like image 91
mark Avatar answered Sep 18 '22 10:09

mark