So you have also got it :)? This is one of the more strange errors in the Zend Framework if you ask me. One way to get it is to give the init function the “wrong” name in the bootstrap class:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initAutoload() { $loader = new Zend_Application_Module_Autoloader(array( 'namespace' => 'Application', 'basePath' => APPLICATION_PATH )); return $loader; } protected function _initDbAdapter() { $this->bootstrap('db'); $db = $this->getResource('db'); Zend_Registry::set('db' , $db); } protected function _initConfig() { Zend_Registry::set('config', $this->getOptions()); } protected function _initTranslate() { $this->bootstrap("translate"); $translator = $this->getResource("translate"); Zend_Registry::set('translator', $translator); } }
You see something wrong here? I didn’t 🙂 But there is a problem with ‘initTranslate()’ function. The last part of the name is ‘Translate’ which is the same as the
$this->bootstrap("translate");
call. If the bootstrap call is ‘translate’ you can not name the init function ‘Translate’ (case does not matter) so you have to do this:
protected function _initTranslator() { // not '_initTranslate' $this->bootstrap("translate"); $translator = $this->getResource("translate"); Zend_Registry::set('translator', $translator); }
Now the name of the function and the bootstrap call are different from each other which should make the error go away
Hope this saves someone some time. Tested in Zend Framework 1.10