如果我理解正確的話,你需要設置你的視圖助手路徑引導或的application.ini,我這樣做是在引導:
protected function _initView()
{
//Initialize view
$view = new Zend_View();
//add custom view helper path
$view->addHelperPath('/../library/Namespace/View/Helper');
//do more stuff if needed
//add it to the view renderer
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper(
'ViewRenderer');
$viewRenderer->setView($view);
//Return it, so that it can be stored by the bootstrap
return $view;
}
還請確保您的模塊,包括它自己的引導文件,這能夠加載資源的模塊:
//at /application/modules/module/bootstrap.php
class Module_Bootstrap extends Zend_Application_Module_Bootstrap
{
//just an empty class is enough
}
希望這有助於
你正確理解。但是我經過了更多的搜索之後,已經找到了答案。我添加了視圖幫助程序目錄到application.ini,謝謝! – bkwint