如何添加视图助手目录(Zend框架) [英] How to add a view helper directory (zend framework)
问题描述
我从ZF(1.9.7)开始,我想使用我所有项目之间共享的库中的View Helpers.但是我找不到如何将其目录添加到助手路径.当我将他们放入应用程序的帮助程序路径时,我的牧民会被罚款.
I begin with ZF (1.9.7), and I want to use View Helpers from a library shared between all my projects. But I can't find how to add it directory to the helpers path. My herpers works fines when I put them in application's helpers path.
这是错误,在那里我找到ZF帮助程序的路径以及应用程序的路径.
Here is the error, where I find the path to ZF helpers, and path to the applications ones.
object(ArrayObject)#71 (3) {
["exception"]=>
object(Zend_Loader_PluginLoader_Exception)#70 (6) {
["message:protected"]=>
string(151) "Plugin by name 'Voo' was not found in the registry; used paths:
Zend_View_Helper_: Zend/View/Helper/;C:/ZendStd/www/applis/VOO4_PROJECTX/views\helpers/"
["string:private"]=>
string(0) ""
["code:protected"]=>
int(0)
["file:protected"]=>
string(89) "C:\Program Files\Zend\ZendServer\share\ZendFramework\library\Zend\Loader\PluginLoader.php"
["line:protected"]=>
int(401)
最诚挚的问候
塞德里克
Best regards
Cédric
推荐答案
使用内置的视图Zend_Application资源可以很容易地做到这一点.如果您使用的是ini配置,请添加如下一行:
It can be done very easily with the built in Zend_Application resource for the view. If you're using ini configs, add a line like this:
resources.view.helperPath.My_View_Helper = "My/View/Helper"
键的末尾是类名前缀,值是它们所在的路径.
The end of the key is the class name prefix, and the value the path where they reside.
这篇关于如何添加视图助手目录(Zend框架)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!