File indexing completed on 2024-12-22 05:36:34
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_Controller 0017 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0018 * @license http://framework.zend.com/license/new-bsd New BSD License 0019 * @version $Id$ 0020 */ 0021 0022 /** 0023 * @see Zend_Controller_Action_HelperBroker 0024 */ 0025 // require_once 'Zend/Controller/Action/HelperBroker.php'; 0026 0027 /** 0028 * @see Zend_Controller_Action_Interface 0029 */ 0030 // require_once 'Zend/Controller/Action/Interface.php'; 0031 0032 /** 0033 * @see Zend_Controller_Front 0034 */ 0035 // require_once 'Zend/Controller/Front.php'; 0036 0037 /** 0038 * @category Zend 0039 * @package Zend_Controller 0040 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0041 * @license http://framework.zend.com/license/new-bsd New BSD License 0042 */ 0043 abstract class Zend_Controller_Action implements Zend_Controller_Action_Interface 0044 { 0045 /** 0046 * @var array of existing class methods 0047 */ 0048 protected $_classMethods; 0049 0050 /** 0051 * Word delimiters (used for normalizing view script paths) 0052 * @var array 0053 */ 0054 protected $_delimiters; 0055 0056 /** 0057 * Array of arguments provided to the constructor, minus the 0058 * {@link $_request Request object}. 0059 * @var array 0060 */ 0061 protected $_invokeArgs = array(); 0062 0063 /** 0064 * Front controller instance 0065 * @var Zend_Controller_Front 0066 */ 0067 protected $_frontController; 0068 0069 /** 0070 * Zend_Controller_Request_Abstract object wrapping the request environment 0071 * @var Zend_Controller_Request_Abstract 0072 */ 0073 protected $_request = null; 0074 0075 /** 0076 * Zend_Controller_Response_Abstract object wrapping the response 0077 * @var Zend_Controller_Response_Abstract 0078 */ 0079 protected $_response = null; 0080 0081 /** 0082 * View script suffix; defaults to 'phtml' 0083 * @see {render()} 0084 * @var string 0085 */ 0086 public $viewSuffix = 'phtml'; 0087 0088 /** 0089 * View object 0090 * @var Zend_View_Interface 0091 */ 0092 public $view; 0093 0094 /** 0095 * Helper Broker to assist in routing help requests to the proper object 0096 * 0097 * @var Zend_Controller_Action_HelperBroker 0098 */ 0099 protected $_helper = null; 0100 0101 /** 0102 * Class constructor 0103 * 0104 * The request and response objects should be registered with the 0105 * controller, as should be any additional optional arguments; these will be 0106 * available via {@link getRequest()}, {@link getResponse()}, and 0107 * {@link getInvokeArgs()}, respectively. 0108 * 0109 * When overriding the constructor, please consider this usage as a best 0110 * practice and ensure that each is registered appropriately; the easiest 0111 * way to do so is to simply call parent::__construct($request, $response, 0112 * $invokeArgs). 0113 * 0114 * After the request, response, and invokeArgs are set, the 0115 * {@link $_helper helper broker} is initialized. 0116 * 0117 * Finally, {@link init()} is called as the final action of 0118 * instantiation, and may be safely overridden to perform initialization 0119 * tasks; as a general rule, override {@link init()} instead of the 0120 * constructor to customize an action controller's instantiation. 0121 * 0122 * @param Zend_Controller_Request_Abstract $request 0123 * @param Zend_Controller_Response_Abstract $response 0124 * @param array $invokeArgs Any additional invocation arguments 0125 * @return void 0126 */ 0127 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array()) 0128 { 0129 $this->setRequest($request) 0130 ->setResponse($response) 0131 ->_setInvokeArgs($invokeArgs); 0132 $this->_helper = new Zend_Controller_Action_HelperBroker($this); 0133 $this->init(); 0134 } 0135 0136 /** 0137 * Initialize object 0138 * 0139 * Called from {@link __construct()} as final step of object instantiation. 0140 * 0141 * @return void 0142 */ 0143 public function init() 0144 { 0145 } 0146 0147 /** 0148 * Initialize View object 0149 * 0150 * Initializes {@link $view} if not otherwise a Zend_View_Interface. 0151 * 0152 * If {@link $view} is not otherwise set, instantiates a new Zend_View 0153 * object, using the 'views' subdirectory at the same level as the 0154 * controller directory for the current module as the base directory. 0155 * It uses this to set the following: 0156 * - script path = views/scripts/ 0157 * - helper path = views/helpers/ 0158 * - filter path = views/filters/ 0159 * 0160 * @return Zend_View_Interface 0161 * @throws Zend_Controller_Exception if base view directory does not exist 0162 */ 0163 public function initView() 0164 { 0165 if (!$this->getInvokeArg('noViewRenderer') && $this->_helper->hasHelper('viewRenderer')) { 0166 return $this->view; 0167 } 0168 0169 // require_once 'Zend/View/Interface.php'; 0170 if (isset($this->view) && ($this->view instanceof Zend_View_Interface)) { 0171 return $this->view; 0172 } 0173 0174 $request = $this->getRequest(); 0175 $module = $request->getModuleName(); 0176 $dirs = $this->getFrontController()->getControllerDirectory(); 0177 if (empty($module) || !isset($dirs[$module])) { 0178 $module = $this->getFrontController()->getDispatcher()->getDefaultModule(); 0179 } 0180 $baseDir = dirname($dirs[$module]) . DIRECTORY_SEPARATOR . 'views'; 0181 if (!file_exists($baseDir) || !is_dir($baseDir)) { 0182 // require_once 'Zend/Controller/Exception.php'; 0183 throw new Zend_Controller_Exception('Missing base view directory ("' . $baseDir . '")'); 0184 } 0185 0186 // require_once 'Zend/View.php'; 0187 $this->view = new Zend_View(array('basePath' => $baseDir)); 0188 0189 return $this->view; 0190 } 0191 0192 /** 0193 * Render a view 0194 * 0195 * Renders a view. By default, views are found in the view script path as 0196 * <controller>/<action>.phtml. You may change the script suffix by 0197 * resetting {@link $viewSuffix}. You may omit the controller directory 0198 * prefix by specifying boolean true for $noController. 0199 * 0200 * By default, the rendered contents are appended to the response. You may 0201 * specify the named body content segment to set by specifying a $name. 0202 * 0203 * @see Zend_Controller_Response_Abstract::appendBody() 0204 * @param string|null $action Defaults to action registered in request object 0205 * @param string|null $name Response object named path segment to use; defaults to null 0206 * @param bool $noController Defaults to false; i.e. use controller name as subdir in which to search for view script 0207 * @return void 0208 */ 0209 public function render($action = null, $name = null, $noController = false) 0210 { 0211 if (!$this->getInvokeArg('noViewRenderer') && $this->_helper->hasHelper('viewRenderer')) { 0212 return $this->_helper->viewRenderer->render($action, $name, $noController); 0213 } 0214 0215 $view = $this->initView(); 0216 $script = $this->getViewScript($action, $noController); 0217 0218 $this->getResponse()->appendBody( 0219 $view->render($script), 0220 $name 0221 ); 0222 } 0223 0224 /** 0225 * Render a given view script 0226 * 0227 * Similar to {@link render()}, this method renders a view script. Unlike render(), 0228 * however, it does not autodetermine the view script via {@link getViewScript()}, 0229 * but instead renders the script passed to it. Use this if you know the 0230 * exact view script name and path you wish to use, or if using paths that do not 0231 * conform to the spec defined with getViewScript(). 0232 * 0233 * By default, the rendered contents are appended to the response. You may 0234 * specify the named body content segment to set by specifying a $name. 0235 * 0236 * @param string $script 0237 * @param string $name 0238 * @return void 0239 */ 0240 public function renderScript($script, $name = null) 0241 { 0242 if (!$this->getInvokeArg('noViewRenderer') && $this->_helper->hasHelper('viewRenderer')) { 0243 return $this->_helper->viewRenderer->renderScript($script, $name); 0244 } 0245 0246 $view = $this->initView(); 0247 $this->getResponse()->appendBody( 0248 $view->render($script), 0249 $name 0250 ); 0251 } 0252 0253 /** 0254 * Construct view script path 0255 * 0256 * Used by render() to determine the path to the view script. 0257 * 0258 * @param string $action Defaults to action registered in request object 0259 * @param bool $noController Defaults to false; i.e. use controller name as subdir in which to search for view script 0260 * @return string 0261 * @throws Zend_Controller_Exception with bad $action 0262 */ 0263 public function getViewScript($action = null, $noController = null) 0264 { 0265 if (!$this->getInvokeArg('noViewRenderer') && $this->_helper->hasHelper('viewRenderer')) { 0266 $viewRenderer = $this->_helper->getHelper('viewRenderer'); 0267 if (null !== $noController) { 0268 $viewRenderer->setNoController($noController); 0269 } 0270 return $viewRenderer->getViewScript($action); 0271 } 0272 0273 $request = $this->getRequest(); 0274 if (null === $action) { 0275 $action = $request->getActionName(); 0276 } elseif (!is_string($action)) { 0277 // require_once 'Zend/Controller/Exception.php'; 0278 throw new Zend_Controller_Exception('Invalid action specifier for view render'); 0279 } 0280 0281 if (null === $this->_delimiters) { 0282 $dispatcher = Zend_Controller_Front::getInstance()->getDispatcher(); 0283 $wordDelimiters = $dispatcher->getWordDelimiter(); 0284 $pathDelimiters = $dispatcher->getPathDelimiter(); 0285 $this->_delimiters = array_unique(array_merge($wordDelimiters, (array) $pathDelimiters)); 0286 } 0287 0288 $action = str_replace($this->_delimiters, '-', $action); 0289 $script = $action . '.' . $this->viewSuffix; 0290 0291 if (!$noController) { 0292 $controller = $request->getControllerName(); 0293 $controller = str_replace($this->_delimiters, '-', $controller); 0294 $script = $controller . DIRECTORY_SEPARATOR . $script; 0295 } 0296 0297 return $script; 0298 } 0299 0300 /** 0301 * Return the Request object 0302 * 0303 * @return Zend_Controller_Request_Abstract 0304 */ 0305 public function getRequest() 0306 { 0307 return $this->_request; 0308 } 0309 0310 /** 0311 * Set the Request object 0312 * 0313 * @param Zend_Controller_Request_Abstract $request 0314 * @return Zend_Controller_Action 0315 */ 0316 public function setRequest(Zend_Controller_Request_Abstract $request) 0317 { 0318 $this->_request = $request; 0319 return $this; 0320 } 0321 0322 /** 0323 * Return the Response object 0324 * 0325 * @return Zend_Controller_Response_Abstract 0326 */ 0327 public function getResponse() 0328 { 0329 return $this->_response; 0330 } 0331 0332 /** 0333 * Set the Response object 0334 * 0335 * @param Zend_Controller_Response_Abstract $response 0336 * @return Zend_Controller_Action 0337 */ 0338 public function setResponse(Zend_Controller_Response_Abstract $response) 0339 { 0340 $this->_response = $response; 0341 return $this; 0342 } 0343 0344 /** 0345 * Set invocation arguments 0346 * 0347 * @param array $args 0348 * @return Zend_Controller_Action 0349 */ 0350 protected function _setInvokeArgs(array $args = array()) 0351 { 0352 $this->_invokeArgs = $args; 0353 return $this; 0354 } 0355 0356 /** 0357 * Return the array of constructor arguments (minus the Request object) 0358 * 0359 * @return array 0360 */ 0361 public function getInvokeArgs() 0362 { 0363 return $this->_invokeArgs; 0364 } 0365 0366 /** 0367 * Return a single invocation argument 0368 * 0369 * @param string $key 0370 * @return mixed 0371 */ 0372 public function getInvokeArg($key) 0373 { 0374 if (isset($this->_invokeArgs[$key])) { 0375 return $this->_invokeArgs[$key]; 0376 } 0377 0378 return null; 0379 } 0380 0381 /** 0382 * Get a helper by name 0383 * 0384 * @param string $helperName 0385 * @return Zend_Controller_Action_Helper_Abstract 0386 */ 0387 public function getHelper($helperName) 0388 { 0389 return $this->_helper->{$helperName}; 0390 } 0391 0392 /** 0393 * Get a clone of a helper by name 0394 * 0395 * @param string $helperName 0396 * @return Zend_Controller_Action_Helper_Abstract 0397 */ 0398 public function getHelperCopy($helperName) 0399 { 0400 return clone $this->_helper->{$helperName}; 0401 } 0402 0403 /** 0404 * Set the front controller instance 0405 * 0406 * @param Zend_Controller_Front $front 0407 * @return Zend_Controller_Action 0408 */ 0409 public function setFrontController(Zend_Controller_Front $front) 0410 { 0411 $this->_frontController = $front; 0412 return $this; 0413 } 0414 0415 /** 0416 * Retrieve Front Controller 0417 * 0418 * @return Zend_Controller_Front 0419 */ 0420 public function getFrontController() 0421 { 0422 // Used cache version if found 0423 if (null !== $this->_frontController) { 0424 return $this->_frontController; 0425 } 0426 0427 // Grab singleton instance, if class has been loaded 0428 if (class_exists('Zend_Controller_Front')) { 0429 $this->_frontController = Zend_Controller_Front::getInstance(); 0430 return $this->_frontController; 0431 } 0432 0433 // Throw exception in all other cases 0434 // require_once 'Zend/Controller/Exception.php'; 0435 throw new Zend_Controller_Exception('Front controller class has not been loaded'); 0436 } 0437 0438 /** 0439 * Pre-dispatch routines 0440 * 0441 * Called before action method. If using class with 0442 * {@link Zend_Controller_Front}, it may modify the 0443 * {@link $_request Request object} and reset its dispatched flag in order 0444 * to skip processing the current action. 0445 * 0446 * @return void 0447 */ 0448 public function preDispatch() 0449 { 0450 } 0451 0452 /** 0453 * Post-dispatch routines 0454 * 0455 * Called after action method execution. If using class with 0456 * {@link Zend_Controller_Front}, it may modify the 0457 * {@link $_request Request object} and reset its dispatched flag in order 0458 * to process an additional action. 0459 * 0460 * Common usages for postDispatch() include rendering content in a sitewide 0461 * template, link url correction, setting headers, etc. 0462 * 0463 * @return void 0464 */ 0465 public function postDispatch() 0466 { 0467 } 0468 0469 /** 0470 * Proxy for undefined methods. Default behavior is to throw an 0471 * exception on undefined methods, however this function can be 0472 * overridden to implement magic (dynamic) actions, or provide run-time 0473 * dispatching. 0474 * 0475 * @param string $methodName 0476 * @param array $args 0477 * @return void 0478 * @throws Zend_Controller_Action_Exception 0479 */ 0480 public function __call($methodName, $args) 0481 { 0482 // require_once 'Zend/Controller/Action/Exception.php'; 0483 if ('Action' == substr($methodName, -6)) { 0484 $action = substr($methodName, 0, strlen($methodName) - 6); 0485 throw new Zend_Controller_Action_Exception(sprintf('Action "%s" does not exist and was not trapped in __call()', $action), 404); 0486 } 0487 0488 throw new Zend_Controller_Action_Exception(sprintf('Method "%s" does not exist and was not trapped in __call()', $methodName), 500); 0489 } 0490 0491 /** 0492 * Dispatch the requested action 0493 * 0494 * @param string $action Method name of action 0495 * @return void 0496 */ 0497 public function dispatch($action) 0498 { 0499 // Notify helpers of action preDispatch state 0500 $this->_helper->notifyPreDispatch(); 0501 0502 $this->preDispatch(); 0503 if ($this->getRequest()->isDispatched()) { 0504 if (null === $this->_classMethods) { 0505 $this->_classMethods = get_class_methods($this); 0506 } 0507 0508 // If pre-dispatch hooks introduced a redirect then stop dispatch 0509 // @see ZF-7496 0510 if (!($this->getResponse()->isRedirect())) { 0511 // preDispatch() didn't change the action, so we can continue 0512 if ($this->getInvokeArg('useCaseSensitiveActions') || in_array($action, $this->_classMethods)) { 0513 if ($this->getInvokeArg('useCaseSensitiveActions')) { 0514 trigger_error('Using case sensitive actions without word separators is deprecated; please do not rely on this "feature"'); 0515 } 0516 $this->$action(); 0517 } else { 0518 $this->__call($action, array()); 0519 } 0520 } 0521 $this->postDispatch(); 0522 } 0523 0524 // whats actually important here is that this action controller is 0525 // shutting down, regardless of dispatching; notify the helpers of this 0526 // state 0527 $this->_helper->notifyPostDispatch(); 0528 } 0529 0530 /** 0531 * Call the action specified in the request object, and return a response 0532 * 0533 * Not used in the Action Controller implementation, but left for usage in 0534 * Page Controller implementations. Dispatches a method based on the 0535 * request. 0536 * 0537 * Returns a Zend_Controller_Response_Abstract object, instantiating one 0538 * prior to execution if none exists in the controller. 0539 * 0540 * {@link preDispatch()} is called prior to the action, 0541 * {@link postDispatch()} is called following it. 0542 * 0543 * @param null|Zend_Controller_Request_Abstract $request Optional request 0544 * object to use 0545 * @param null|Zend_Controller_Response_Abstract $response Optional response 0546 * object to use 0547 * @return Zend_Controller_Response_Abstract 0548 */ 0549 public function run(Zend_Controller_Request_Abstract $request = null, Zend_Controller_Response_Abstract $response = null) 0550 { 0551 if (null !== $request) { 0552 $this->setRequest($request); 0553 } else { 0554 $request = $this->getRequest(); 0555 } 0556 0557 if (null !== $response) { 0558 $this->setResponse($response); 0559 } 0560 0561 $action = $request->getActionName(); 0562 if (empty($action)) { 0563 $action = 'index'; 0564 } 0565 $action = $action . 'Action'; 0566 0567 $request->setDispatched(true); 0568 $this->dispatch($action); 0569 0570 return $this->getResponse(); 0571 } 0572 0573 /** 0574 * Gets a parameter from the {@link $_request Request object}. If the 0575 * parameter does not exist, NULL will be returned. 0576 * 0577 * If the parameter does not exist and $default is set, then 0578 * $default will be returned instead of NULL. 0579 * 0580 * @param string $paramName 0581 * @param mixed $default 0582 * @return mixed 0583 */ 0584 protected function _getParam($paramName, $default = null) 0585 { 0586 return $this->getParam($paramName, $default); 0587 } 0588 0589 /** 0590 * Gets a parameter from the {@link $_request Request object}. If the 0591 * parameter does not exist, NULL will be returned. 0592 * 0593 * If the parameter does not exist and $default is set, then 0594 * $default will be returned instead of NULL. 0595 * 0596 * @param string $paramName 0597 * @param mixed $default 0598 * @return mixed 0599 */ 0600 public function getParam($paramName, $default = null) 0601 { 0602 $value = $this->getRequest()->getParam($paramName); 0603 if ((null === $value || '' === $value) && (null !== $default)) { 0604 $value = $default; 0605 } 0606 0607 return $value; 0608 } 0609 0610 /** 0611 * Set a parameter in the {@link $_request Request object}. 0612 * 0613 * @param string $paramName 0614 * @param mixed $value 0615 * @return Zend_Controller_Action 0616 * @deprecated Deprecated as of Zend Framework 1.7. Use 0617 * setParam() instead. 0618 */ 0619 protected function _setParam($paramName, $value) 0620 { 0621 return $this->setParam($paramName, $value); 0622 } 0623 0624 /** 0625 * Set a parameter in the {@link $_request Request object}. 0626 * 0627 * @param string $paramName 0628 * @param mixed $value 0629 * @return Zend_Controller_Action 0630 */ 0631 public function setParam($paramName, $value) 0632 { 0633 $this->getRequest()->setParam($paramName, $value); 0634 0635 return $this; 0636 } 0637 0638 /** 0639 * Determine whether a given parameter exists in the 0640 * {@link $_request Request object}. 0641 * 0642 * @param string $paramName 0643 * @return boolean 0644 * @deprecated Deprecated as of Zend Framework 1.7. Use 0645 * hasParam() instead. 0646 */ 0647 protected function _hasParam($paramName) 0648 { 0649 return $this->hasParam($paramName); 0650 } 0651 0652 /** 0653 * Determine whether a given parameter exists in the 0654 * {@link $_request Request object}. 0655 * 0656 * @param string $paramName 0657 * @return boolean 0658 */ 0659 public function hasParam($paramName) 0660 { 0661 return null !== $this->getRequest()->getParam($paramName); 0662 } 0663 0664 /** 0665 * Return all parameters in the {@link $_request Request object} 0666 * as an associative array. 0667 * 0668 * @return array 0669 * @deprecated Deprecated as of Zend Framework 1.7. Use 0670 * getAllParams() instead. 0671 */ 0672 protected function _getAllParams() 0673 { 0674 return $this->getAllParams(); 0675 } 0676 0677 /** 0678 * Return all parameters in the {@link $_request Request object} 0679 * as an associative array. 0680 * 0681 * @return array 0682 */ 0683 public function getAllParams() 0684 { 0685 return $this->getRequest()->getParams(); 0686 } 0687 0688 0689 /** 0690 * Forward to another controller/action. 0691 * 0692 * It is important to supply the unformatted names, i.e. "article" 0693 * rather than "ArticleController". The dispatcher will do the 0694 * appropriate formatting when the request is received. 0695 * 0696 * If only an action name is provided, forwards to that action in this 0697 * controller. 0698 * 0699 * If an action and controller are specified, forwards to that action and 0700 * controller in this module. 0701 * 0702 * Specifying an action, controller, and module is the most specific way to 0703 * forward. 0704 * 0705 * A fourth argument, $params, will be used to set the request parameters. 0706 * If either the controller or module are unnecessary for forwarding, 0707 * simply pass null values for them before specifying the parameters. 0708 * 0709 * @param string $action 0710 * @param string $controller 0711 * @param string $module 0712 * @param array $params 0713 * @return void 0714 * @deprecated Deprecated as of Zend Framework 1.7. Use 0715 * forward() instead. 0716 */ 0717 final protected function _forward($action, $controller = null, $module = null, array $params = null) 0718 { 0719 $this->forward($action, $controller, $module, $params); 0720 } 0721 0722 /** 0723 * Forward to another controller/action. 0724 * 0725 * It is important to supply the unformatted names, i.e. "article" 0726 * rather than "ArticleController". The dispatcher will do the 0727 * appropriate formatting when the request is received. 0728 * 0729 * If only an action name is provided, forwards to that action in this 0730 * controller. 0731 * 0732 * If an action and controller are specified, forwards to that action and 0733 * controller in this module. 0734 * 0735 * Specifying an action, controller, and module is the most specific way to 0736 * forward. 0737 * 0738 * A fourth argument, $params, will be used to set the request parameters. 0739 * If either the controller or module are unnecessary for forwarding, 0740 * simply pass null values for them before specifying the parameters. 0741 * 0742 * @param string $action 0743 * @param string $controller 0744 * @param string $module 0745 * @param array $params 0746 * @return void 0747 */ 0748 final public function forward($action, $controller = null, $module = null, array $params = null) 0749 { 0750 $request = $this->getRequest(); 0751 0752 if (null !== $params) { 0753 $request->setParams($params); 0754 } 0755 0756 if (null !== $controller) { 0757 $request->setControllerName($controller); 0758 0759 // Module should only be reset if controller has been specified 0760 if (null !== $module) { 0761 $request->setModuleName($module); 0762 } 0763 } 0764 0765 $request->setActionName($action) 0766 ->setDispatched(false); 0767 } 0768 0769 /** 0770 * Redirect to another URL 0771 * 0772 * Proxies to {@link Zend_Controller_Action_Helper_Redirector::gotoUrl()}. 0773 * 0774 * @param string $url 0775 * @param array $options Options to be used when redirecting 0776 * @return void 0777 * @deprecated Deprecated as of Zend Framework 1.7. Use 0778 * redirect() instead. 0779 */ 0780 protected function _redirect($url, array $options = array()) 0781 { 0782 $this->redirect($url, $options); 0783 } 0784 0785 /** 0786 * Redirect to another URL 0787 * 0788 * Proxies to {@link Zend_Controller_Action_Helper_Redirector::gotoUrl()}. 0789 * 0790 * @param string $url 0791 * @param array $options Options to be used when redirecting 0792 * @return void 0793 */ 0794 public function redirect($url, array $options = array()) 0795 { 0796 $this->_helper->redirector->gotoUrl($url, $options); 0797 } 0798 }