-- Ralf Kramer <[EMAIL PROTECTED]> wrote
(on Monday, 22 October 2007, 05:40 AM +0200):
> now it complains about:
>
> Fatal error: Call to protected method Zend_Controller_Action::_forward()
> from context 'Quasda_User_Helpers_UserHelper'
> in /www/quasda/library/Quasda/User/Helpers/UserHelper.php on line 8
That's because _forward() is a protected method in
Zend_Controller_Action; you can't call it from a public instance of the
object.
The equivalent code is pretty simple:
$this->getRequest()
->setModuleName($module)
->setControllerName($controller)
->setActionName($action)
->setParams($params)
->setDispatched(false);
The last line is the most important of them, as it sets the flag that
the dispatch loop looks at in determining whether or not to iterate
again.
> Am Sonntag, den 21.10.2007, 21:38 -0500 schrieb Ralph Schindler:
> > Ralf Kramer wrote:
> >
> > >
> > > public function init()
> > > {
> > > Zend_Controller_Action_HelperBroker::addPrefix('Quasda_User_Helpers');
> > > $helper = Zend_Controller_Action_HelperBroker::getHelper("User_Helper");
> > > $helper->doSmth();
> > > }
> > >
> >
> >
> > Try this:
> >
> > public function init()
> > {
> > Zend_Controller_Action_HelperBroker::addPrefix('Quasda_User_Helpers');
> > $helper = $this->_helper->getHelper('User_Helper');
> > $helper->doSmth();
> > }
> >
> > Reason being is that you want to use the helper broker that is specific
> > to the current ActionController. That way, the helper you are trying to
> > use will have an instance of the ActionController itself.
> >
> > -ralph
>
--
Matthew Weier O'Phinney
PHP Developer | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/