Class Zend_Controller_Action_Helper_Redirector

Description
  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Controller/Action/Helper/Redirector.php (line 34)

Zend_Controller_Action_Helper_Abstract
   |
   --Zend_Controller_Action_Helper_Redirector
Variable Summary
 int $_code
 bool $_exit
 string $_redirectUrl
Method Summary
 void direct (string $action, [string $controller = null], [string $module = null], [ $params = array()])
 int getCode ()
 bool getExit ()
 bool getPrependBase ()
 string getRedirectUrl ()
 void goto (string $action, [string $controller = null], [string $module = null], [ $params = array()])
 void gotoAndExit (mixed $action, [mixed $controller = null], [mixed $module = null], [ $params = array()])
 void gotoRoute ([ $urlOptions = array()], [string $name = null], [boolean $reset = false])
 void gotoRouteAndExit ([ $urlOptions = array()], [string $name = null], [boolean $reset = false])
 void gotoUrl (string $url, [ $options = array()])
 void gotoUrlAndExit (string $url, [ $options = null])
 void redirectAndExit ()
 void setGoto (string $action, [string $controller = null], [string $module = null], [ $params = array()])
 void setGotoRoute ([ $urlOptions = array()], [string $name = null], [boolean $reset = false])
 void setGotoUrl (string $url, [ $options = array()])
 true _checkCode (int $code)
 string _prependBase (string $url)
 void _redirect ( $url)
Variables
int $_code = 302 (line 40)

HTTP status code for redirects

  • access: protected
bool $_exit = true (line 46)

Whether or not calls to _redirect() should exit script execution

  • access: protected
bool $_prependBase = true (line 53)

Whether or not _redirect() should attempt to prepend the base URL to the

passed URL (if it's a relative URL)

  • access: protected
string $_redirectUrl = null (line 59)

Url to which to redirect

  • access: protected

Inherited Variables

Inherited from Zend_Controller_Action_Helper_Abstract

Zend_Controller_Action_Helper_Abstract::$_actionController
Zend_Controller_Action_Helper_Abstract::$_request
Zend_Controller_Action_Helper_Abstract::$_response
Methods
direct (line 440)

direct(): Perform helper when called as $this->_helper->redirector($action, $controller, $module, $params)

  • access: public
void direct (string $action, [string $controller = null], [string $module = null], [ $params = array()])
  • string $action
  • string $controller
  • string $module
  • array $params
getCode (line 66)

Retrieve HTTP status code to emit on _redirect() call

  • access: public
int getCode ()
getExit (line 106)

Retrieve flag for whether or not _redirect() will exit when finished.

  • access: public
bool getExit ()
getPrependBase (line 129)

Retrieve flag for whether or not _redirect() will prepend the base URL on relative URLs

  • access: public
bool getPrependBase ()
getRedirectUrl (line 162)

Retrieve currently set URL for redirect

  • access: public
string getRedirectUrl ()
goto (line 322)

Perform a redirect to an action/controller/module with params

  • access: public
void goto (string $action, [string $controller = null], [string $module = null], [ $params = array()])
  • string $action
  • string $controller
  • string $module
  • array $params
gotoAndExit (line 340)

Perform a redirect to an action/controller/module with params, forcing an immdiate exit

  • access: public
void gotoAndExit (mixed $action, [mixed $controller = null], [mixed $module = null], [ $params = array()])
  • mixed $action
  • mixed $controller
  • mixed $module
  • array $params
gotoRoute (line 357)

Redirect to a route-based URL

Uses route's assemble method tobuild the URL; route is specified by $name; default route is used if none provided.

  • access: public
void gotoRoute ([ $urlOptions = array()], [string $name = null], [boolean $reset = false])
  • array $urlOptions: Array of key/value pairs used to assemble URL
  • string $name
  • boolean $reset
gotoRouteAndExit (line 377)

Redirect to a route-based URL, and immediately exit

Uses route's assemble method tobuild the URL; route is specified by $name; default route is used if none provided.

  • access: public
void gotoRouteAndExit ([ $urlOptions = array()], [string $name = null], [boolean $reset = false])
  • array $urlOptions: Array of key/value pairs used to assemble URL
  • string $name
  • boolean $reset
gotoUrl (line 390)

Perform a redirect to a url

  • access: public
void gotoUrl (string $url, [ $options = array()])
  • string $url
  • array $options
gotoUrlAndExit (line 406)

Set a URL string for a redirect, perform redirect, and immediately exit

  • access: public
void gotoUrlAndExit (string $url, [ $options = null])
  • string $url
  • array $options
redirectAndExit (line 417)

exit(): Perform exit for redirector

  • access: public
void redirectAndExit ()
setCode (line 94)

Retrieve HTTP status code for _redirect() behaviour

  • access: public
  • int $code
setExit (line 117)

Retrieve exit flag for _redirect() behaviour

  • access: public
  • bool $flag
setGoto (line 197)

Set a redirect URL of the form /module/controller/action/params

  • access: public
void setGoto (string $action, [string $controller = null], [string $module = null], [ $params = array()])
  • string $action
  • string $controller
  • string $module
  • array $params
setGotoRoute (line 238)

Build a URL based on a route

  • access: public
void setGotoRoute ([ $urlOptions = array()], [string $name = null], [boolean $reset = false])
  • array $urlOptions
  • string $name: Route name
  • boolean $reset
setGotoUrl (line 285)

Set a redirect URL string

By default, emits a 302 HTTP status header, prepends base URL as defined in request object if url is relative, and halts script execution by calling exit().

$options is an optional associative array that can be used to control redirect behaviour. The available option keys are:

  • exit: boolean flag indicating whether or not to halt script execution when done
  • prependBase: boolean flag indicating whether or not to prepend the base URL when a relative URL is provided
  • code: integer HTTP status code to use with redirect. Should be between 300 and 307.
_redirect() sets the Location header in the response object. If you set the exit flag to false, you can override this header later in code execution.

If the exit flag is true (true by default), _redirect() will write and close the current session, if any.

  • access: public
void setGotoUrl (string $url, [ $options = array()])
  • string $url
  • array $options
setPrependBase (line 140)

Retrieve 'prepend base' flag for _redirect() behaviour

  • access: public
Zend_Controller_Action_Helper_Redirector setPrependBase (bool $flag)
  • bool $flag
_checkCode (line 78)

Validate HTTP status redirect code

  • throws: Zend_Controller_Action_Exception on invalid HTTP status code
  • access: protected
true _checkCode (int $code)
  • int $code
_prependBase (line 173)

Determine if the baseUrl should be prepended, and prepend if necessary

  • access: protected
string _prependBase (string $url)
  • string $url
_redirect (line 151)

Set redirect in response object

  • access: protected
void _redirect ( $url)
  • $url

Inherited Methods

Inherited From Zend_Controller_Action_Helper_Abstract

 Zend_Controller_Action_Helper_Abstract::getActionController()
 Zend_Controller_Action_Helper_Abstract::getName()
 Zend_Controller_Action_Helper_Abstract::getRequest()
 Zend_Controller_Action_Helper_Abstract::getResponse()
 Zend_Controller_Action_Helper_Abstract::init()
 Zend_Controller_Action_Helper_Abstract::postDispatch()
 Zend_Controller_Action_Helper_Abstract::preDispatch()
 Zend_Controller_Action_Helper_Abstract::setActionController()

Documentation generated on Sun, 27 May 2007 23:27:03 -0700 by phpDocumentor 1.3.2