Okay I see I have to add
$priv = $this->_helper->getHelper('Priv');
and then it works.
But why would I not just go
$priv = new Hs_Action_Helper_Priv?
What I was hoping for is that action helpers would work like view helpers:
register it in the bootstrap and then anywhere in the controller just call
the method - ie take out the above step.
Waigani wrote:
>
> Hi,
>
> I've written a custom helper:
>
> class Hs_Action_Helper_Priv extends
> Zend_Controller_Action_Helper_Abstract{
>
> function Priv($priv){
> $AclCk = new Hs_Acl_Auth();
> return $AclCk->Priv($priv);
> }
>
> }
>
>
> Registered it in the bootstrap:
>
> Zend_Controller_Action_HelperBroker::addPrefix('Hs_Action_Helper');
>
>
> and called it in an action:
>
> $this->_helper->priv('hello');
>
>
>
> I get the error:
>
> Cannot redeclare IndexController::indexAction()
>
>
>
> Any clues?
>
> Thanks,
>
--
View this message in context:
http://www.nabble.com/Action-Helper-tf4477038s16154.html#a12766052
Sent from the Zend Framework mailing list archive at Nabble.com.