如何在zend框架中注册新的助手(自定义助手)

|| 我使用$ view-> addHelperPath和registerHelper我想要的是当我去查看脚本文件并执行$ this-> [myhlper方法]从我的帮助器类中获取数据时!我试图在application.ini中设置路径,但是那也不起作用,那么怎么办呢?     
已邀请:
        在您的Bootstrap中,添加以下方法:
protected function _initView()
{
        $view = $this->bootstrap(\'layout\')->getResource(\'layout\')->getView();
        $view->addHelperPath(\'Your/Custom/Path/\', \'Your_Custom_Path\');

        $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
        $viewRenderer->setView($view);

        Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
}
    
        您可以像我一样在引导程序中添加此“ 1”通话     

要回复问题请先登录注册