GetHelper() on the helper broker is a instance method.
To get it statically, you need to use
Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->goto('in
dex');
Side note: try and develop with E_STRICT turned on it will alert you of
notices like accessing instance methods/properties statically.
-ralph
On 12/19/08 5:42 AM, "Bart McLeod" <[email protected]> wrote:
> Hi All,
>
> I want to use the redirector helper from within another action helper and I
> call:
> Zend_Controller_Action_HelperBroker::getHelper('redirector')->goto('index');
>
> This yields an error:
> Fatal error: Cannot access protected property
> Shop_Action_Helper_InitShop::$_actionController in
> D:\ZendFramework\library\Zend\Controller\Action\HelperBroker.php on line 305
>
> Should I use magic __get to return $this->_actionController, or is this a bug
> and should the helper broker call $this->getActionController for example?
>
> Or should I not call this static function from within an action helper?
>
> It also happens if I use this static call from within an action controller,
> but there I circumvented the error by:
> public $_actionController;//bug workaround
> in my action controller, but this is a hack of course.
>
> Or should I not be calling it statically at all? I think I saw an example
> somewhere that demonstrated static usage.
>
> Bart
--
Ralph Schindler
Software Engineer | [email protected]
Zend Framework | http://framework.zend.com/