我想将变量发送到 zend 框架中的布局,我尝试为其创建一个控制器插件并将其放置在
application
/plugins
并将文件命名为layout.php
,这是来自的代码layout.php
class Plugin_Layout extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$layout = Zend_Layout::getMvcInstance();
$view = $layout->getView();
$view->foo = 'bar';
}
}
现在我想用application.ini
我尝试添加的frontController注册插件
includePaths.plugin = APPLICATION_PATH "/plugins"
autoloaderNamespaces[] = "Plugin_"
resources.frontController.plugins[] = "Plugin_Layout"
它向我显示以下错误。
Warning: include_once(Plugin/Layout.php) [function.include-once]: failed to open stream: No such file or directory in /Users/azhararmar/htdocs/joofris/library/Zend/Loader.php on line 146
我是zend框架的新手。我哪里错了?