問(wèn)題描述
我從 ZF (1.9.7) 開始,我想使用我所有項(xiàng)目之間共享的庫(kù)中的查看助手.但是我找不到如何將它的目錄添加到 helpers 路徑.當(dāng)我將 Herpers 放入應(yīng)用程序的 helpers 路徑時(shí),它們可以正常工作.
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.
這是錯(cuò)誤,我在這里找到了 ZF 幫助程序的路徑和應(yīng)用程序的路徑.
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/viewshelpers/"
["string:private"]=>
string(0) ""
["code:protected"]=>
int(0)
["file:protected"]=>
string(89) "C:Program FilesendendServershareendFrameworklibraryendLoaderPluginLoader.php"
["line:protected"]=>
int(401)
最好的問(wèn)候
塞德里克
Best regards
Cédric
推薦答案
使用視圖的內(nèi)置 Zend_Application 資源可以非常輕松地完成.如果您使用的是 ini 配置,請(qǐng)?zhí)砑尤缦乱恍?
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"
鍵的結(jié)尾是類名前綴,值是它們所在的路徑.
The end of the key is the class name prefix, and the value the path where they reside.
這篇關(guān)于如何添加視圖助手目錄(zend 框架)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!