开发者

unable to load the helper class inside a module in zend frame work

hi i am a newbie in zend frame work.. pls help mee i am going through a registration module. and in that module there is separate helper file called Tools for calculating age... date comparison etc while trying to create object of Users_View_Helper_Tools in indexAction getting a fattal error of Users_Vie开发者_开发技巧w_Helper_Tools not found how will will we autoload the helper files in the modules


In bootstrap:

Zend_Controller_Action_HelperBroker::addPath(
    'Path/To/Where/Your/Helper/Is',
    'Path_To_Where_Your_Helper_Is'
);

In controller:

$this->_helper->myHelper();

The helper would look like this:

class Path_To_Where_Your_Helper_Is_MyHelper extends Zend_Controller_Action_Helper_Abstract
{   
    public function direct()
    {
        echo 'Hello';
    }
}


To add a helper path, use addHelperPath(); the docs will help you:

http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.paths

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜