就像在主题中一样,我在视图帮助器中有两个静态方法,但是当我尝试通过
调用控制器操作时Zend_View_Helper_SomeHelper::firstStaticMethod();
我收到了错误:
Warning: include_once(Zend/View/Helper/SomeHelper.php): failed to open stream: No such file or directory in /library/Zend/Loader.php on line 134 Warning: include_once(): Failed opening 'Zend/View/Helper/SomeHelper.php' for inclusion (include_path='/application/../library:/library:.:/usr/share/pear:/usr/share/php') in /library/Zend/Loader.php on line 134 Fatal error: Class 'Zend_View_Helper_SomeHelper' not found in /application/modules/default/controllers/Controller.php on line 174
帮助程序代码:
class Zend_View_Helper_SomeHelper extends Zend_View_Helper_Abstract {
//....//
public static function firstStaticMethod(){
//some code hear
}
public static function secoundStaticMethod(){
//some code hear
}
}
我需要在帮助器和操作中使用此方法。 任何想法?
答案 0 :(得分:1)
你能试试吗
$viewHelperObj = $this->view->getHelper('SomeHelper');
$viewHelperObj->secoundStaticMethod();