我想送变量在Zend框架的布局,我尝试创建一个控制器插件,并把它放在注册控制器插件与Zend Framework的前端控制器
,并命名该文件作为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';
}
}
现在我想注册frontController设计插件在application.ini
针对我尝试添加代码
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框架。我哪里错了?
我需要这个'pluginPaths.Plugins = APPLICATION_PATH“/插件”它现在工作。你:) – 2012-04-08 04:25:35