I have this plugin in the plugins
directory within the admin module directory. So, it is in application/modules/admin/plugins/LayoutPlugin.php
:
<?php
class LayoutPlugin extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$layout = Zend_Layout::getMvcInstance();
$view = $layout->getView();
$view->whatever = 'foo';
}
}
I'd like to use it for sending variables to the layout view. It happens that I get Fatal error: Class 'LayoutPlugin' not found
every time I try Zend_Controller_Front::getInstance()->registerPlugin(new LayoutPlugin());
in the admin bootstrap.
How do I load a plugin inside a module?