我想创建一个属于我自己的帮手。 Safecheck
文件夹位于library
文件夹中,并包含一个Helper
文件夹。该课程名为Safecheck_Helper_Authority.php
(在library/Safecheck/Helper
之内)。Zend:没有找到行动帮手
在Bootstrap.php
:
protected function _initHelper()
{
Zend_Controller_Action_HelperBroker::addPrefix('Safecheck_Helper');
}
在Safecheck_Helper_Authority.php
:
class Safecheck_Helper_Authority extends Zend_Controller_Action_Helper_Abstract
{
public function hasAuthority($userId, array $ids)
{
}
}
我想这个用户类中的功能。但我得到的错误“消息:动作助手的名字管理局未发现”,通过下面的代码触发:
$this->_helper->authority('hasAuthority');
也许我不会用正确的代码中调用呢?我错过了什么吗?