Exemple #1
0
 /**
  * Forwards the request to another action and / or controller.
  *
  * Request is directly transferred to the other action / controller
  * without the need for a new request.
  *
  * @param string $actionName Name of the action to forward to
  * @param string $controllerName Unqualified object name of the controller to forward to. If not specified, the current controller is used.
  * @param string $extensionName Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.
  * @param array $arguments Arguments to pass to the target action
  * @return void
  * @throws StopActionException
  * @see redirect()
  * @api
  */
 public function forward($actionName, $controllerName = null, $extensionName = null, array $arguments = null)
 {
     $this->request->setDispatched(false);
     if ($this->request instanceof WebRequest) {
         $this->request->setControllerActionName($actionName);
         if ($controllerName !== null) {
             $this->request->setControllerName($controllerName);
         }
         if ($extensionName !== null) {
             $this->request->setControllerExtensionName($extensionName);
         }
     }
     if ($arguments !== null) {
         $this->request->setArguments($arguments);
     }
     throw new StopActionException('forward', 1476045801);
 }
 /**
  * Forwards the request to another action and / or controller.
  *
  * Request is directly transferred to the other action / controller
  * without the need for a new request.
  *
  * @param string $actionName Name of the action to forward to
  * @param string $controllerName Unqualified object name of the controller to forward to. If not specified, the current controller is used.
  * @param string $extensionName Name of the extension containing the controller to forward to. If not specified, the current extension is assumed.
  * @param array $arguments Arguments to pass to the target action
  * @return void
  * @throws StopActionException
  * @see redirect()
  * @api
  */
 public function forward($actionName, $controllerName = NULL, $extensionName = NULL, array $arguments = NULL)
 {
     $this->request->setDispatched(FALSE);
     if ($this->request instanceof WebRequest) {
         $this->request->setControllerActionName($actionName);
         if ($controllerName !== NULL) {
             $this->request->setControllerName($controllerName);
         }
         if ($extensionName !== NULL) {
             $this->request->setControllerExtensionName($extensionName);
         }
     }
     if ($arguments !== NULL) {
         $this->request->setArguments($arguments);
     }
     throw new StopActionException();
 }