// Register the 'redirector' action helper with the helper broker Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_Redirector()); // Use the 'redirector' helper in our controller class MyController extends Zend_Controller_Action { public function fooAction() { $this->_helper->redirector->gotoUrl('/bar'); } }
// Define our custom action helper class MyHelper extends Zend_Controller_Action_Helper_Abstract { public function doSomething() { // Do something amazing! } } // Register our custom helper with the helper broker Zend_Controller_Action_HelperBroker::addHelper(new MyHelper()); // Use our custom helper in our controller class MyController extends Zend_Controller_Action { public function fooAction() { // Call our custom helper's 'doSomething' method $this->_helper->myHelper->doSomething(); } }In both examples, the package library used is the Zend Framework, specifically the Zend_Controller_Action_HelperBroker component.