本文介绍了zend 视图助手配置路径(在引导程序中工作但在 application.ini 中不起作用)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这个问题真让我抓狂.当我在引导文件中添加我的视图助手路径时.
This problem really making me crazy.When I add my view Helper path in bootstrap file.
$view->addHelperPath(APPLICATION_PATH.'/../library/SiteLib/View/Helper/');
它工作得很好.
但是当我将其转移到 APPLICATION.INI 文件(它应该在的位置)时.简单的不行
But when I shift this to APPLICATION.INI file (where it should be). It simple don't work
resources.view[] =
resources.view.helperPath.SiteLib_View_Helper_CssHelper = APPLICATION_PATH "/../library/SiteLib/View/Helper/"
我不知道我做错了什么.任何人都可以请帮助我.
I don't know what I am doing wrong.Can anyone help me please.
这是我的视图助手类
class Zend_View_Helper_CssHelper extends Zend_View_Helper_Abstract
{
function cssHelper() { }
}
Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'CssHelper' in /web/zend/zendbase/library/Zend/Loader/PluginLoader.php on line 412
( ! ) Zend_Loader_PluginLoader_Exception: Plugin by name 'CssHelper' was not found in the registry; used paths: Login_View_Helper_: /web/zend/zendbase/application/modules/login/views/helpers/ ZendX_JQuery_View_Helper_: ZendX/JQuery/View/Helper/ Zend_View_Helper_: Zend/View/Helper/:/web/zend/zendbase/application/../library/SiteLib/View/Helper/:/web/zend/zendbase/application/modules/default/views/helpers/ in /web/zend/zendbase/library/Zend/Loader/PluginLoader.php on line 412
Call Stack
# Time Memory Function Location
1 0.0001 53524 {main}( ) ../index.php:0
2 0.0451 1467432 Zend_Application->run( ) ../index.php:60
3 0.0452 1467432 Zend_Application_Bootstrap_Bootstrap->run( ) ../Application.php:366
4 0.0452 1467432 Zend_Controller_Front->dispatch( ) ../Bo
推荐答案
我终于自己解决了这个问题.
Finally I figure out the problem myself.
我在引导程序中覆盖了 Zend_View
I was overwrite the Zend_View in bootstrap
protected function _initView()
{
$view = new Zend_View($this->getOptions());
$view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
}
我只是在 application.ini 中移动了上面的代码并从引导文件中删除了该函数.它现在正在工作.:)
I just shifted the above code in application.ini and remove that function from bootstrap file. and it is working now. :)
resources.view.helperPath.ZendX_JQuery_View_Helper = APPLICATION_PATH "/ZendX/JQuery/View/Helper"
这篇关于zend 视图助手配置路径(在引导程序中工作但在 application.ini 中不起作用)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!