ZF custom library
Posted: Sat May 28, 2011 8:23 pm
Hey all. I am starting a new zend framework project. I am borrowing code from a previous project on another server. Right now I am stuck trying to get my custom library to auto load.
I get the error:
Fatal error: Class 'myLib_Controller_Plugin_Modularlayout' not found in ***/application/Bootstrap.php on line 44
I used the same code on a different server, but my custom library was named lunaApp before. But everything else is correct.
I have a file located in library/myLib/Controller/Plugin/Modularlayout.php
it has the following class definition:
Any idea what is going wrong?
Code: Select all
protected function _initAppAutoload()
{
$autoloader = new Zend_Application_Module_Autoloader(array(
'namespace' => 'App',
'basePath' => dirname(__FILE__),
));
$this->getApplication()->setAutoloaderNamespaces(array('App', 'myLib'));
return $autoloader;
}
protected function _initPlugins()
{
$this->bootstrap('frontController');
$fc=$this->frontController;
$plugin = new myLib_Controller_Plugin_Modularlayout();
$fc->registerPlugin($plugin);
$aclPugin=new myLib_Plugin_Acl();
$fc->registerPlugin($aclPugin);
$navplugin= new myLib_Plugin_ModuleNavigation();
$fc->registerPlugin($navplugin);
}Fatal error: Class 'myLib_Controller_Plugin_Modularlayout' not found in ***/application/Bootstrap.php on line 44
I used the same code on a different server, but my custom library was named lunaApp before. But everything else is correct.
I have a file located in library/myLib/Controller/Plugin/Modularlayout.php
it has the following class definition:
Code: Select all
class myLib_Controller_Plugin_Modularlayout extends Zend_Controller_Plugin_Abstract
{
public function routeShutdown(Zend_Controller_Request_Abstract $request)
{
$layout=Zend_Layout::getMvcInstance()->setLayout($request->getModuleName());
}
}