Zend_Controller_Request_Http
HTTP request object for use with Zend_Controller family.
uses | |
---|---|
package | Zend_Controller |
subpackage | Request |
inherited_from | \Zend_Controller_Request_Abstract |
__construct(string|\Zend_Uri $uri = null
) : void
If a $uri is passed, the object will attempt to populate itself using that information.
string
\Zend_Uri
\Zend_Controller_Request_Exception |
when invalid URI passed |
---|
__get(string $key) : mixed
__isset(string $key) : boolean
string
boolean
__set(string $key, mixed $value) : void
In order to follow __get(), which operates on a number of superglobals, setting values through overloading is not allowed and will raise an exception. Use setParam() instead.
string
mixed
\Zend_Controller_Request_Exception |
---|
clearParams() : \Zend_Controller_Request_Abstract
\Zend_Controller_Request_Abstract
get(string $key) : mixed
string
mixed
getActionKey() : string
string
getActionName() : string
string
getAlias(string $name) : string | null
Retrieve the actual key represented by the alias $name.
string
string
null
Returns null when no alias existsgetAliases() : array
array
getBasePath() : string
string
getBaseUrl($raw = false
) : string
string
getClientIp(boolean $checkProxy = true
) : string
boolean
string
getControllerKey() : string
string
getControllerName() : string
string
getCookie(string $key= null
, mixed $default= null
) : mixed
If no $key is passed, returns the entire $_COOKIE array.
todo | How to retrieve from nested arrays |
---|
string
mixed
Default value to use if key not found
mixed
Returns null if key does not existgetEnv(string $key= null
, mixed $default= null
) : mixed
If no $key is passed, returns the entire $_ENV array.
string
mixed
Default value to use if key not found
mixed
Returns null if key does not existgetHeader(string $header) : string | false
string
HTTP header name
\Zend_Controller_Request_Exception |
---|
string
false
HTTP header value, or false if not foundgetHttpHost() : string
"Host" ":" host [ ":" port ] ; Section 3.2.2 Note the HTTP Host header is not the same as the URI host. It includes the port while the URI host doesn't.
string
getMethod() : string
string
getModuleKey() : string
string
getModuleName() : string
string
getParam(mixed $key, mixed $default = null
) : mixed
Retrieves a parameter from the instance. Priority is in the order of userland parameters (see \setParam()), $_GET, $_POST. If a parameter matching the $key is not found, null is returned.
If the $key is an alias, the actual key aliased will be used.
inherited_from | \Zend_Controller_Request_Abstract::getParam() |
---|
mixed
mixed
Default value to use if key not found
mixed
getParam(string $key, mixed $default = null
) : mixed
string
mixed
Default value to use if key not found
mixed
getParamSources() : array
array
getParams() : array
Retrieves a merged array of parameters, with precedence of userland params (see \setParam()), $_GET, $_POST (i.e., values in the userland params will take precedence over all others).
inherited_from | \Zend_Controller_Request_Abstract::getParams() |
---|
array
getParams() : array
array
getPathInfo() : string
This value is calculated instead of reading PATH_INFO directly from $_SERVER due to cross-platform differences.
string
getPost(string $key= null
, mixed $default= null
) : mixed
If no $key is passed, returns the entire $_POST array.
todo | How to retrieve from nested arrays |
---|
string
mixed
Default value to use if key not found
mixed
Returns null if key does not existgetQuery(string $key= null
, mixed $default= null
) : mixed
If no $key is passed, returns the entire $_GET array.
todo | How to retrieve from nested arrays |
---|
string
mixed
Default value to use if key not found
mixed
Returns null if key does not existgetRawBody() : string | false
string
false
Raw body, or false if not presentgetRequestUri() : string
string
getScheme() : string
string
getServer(string $key= null
, mixed $default= null
) : mixed
If no $key is passed, returns the entire $_SERVER array.
string
mixed
Default value to use if key not found
mixed
Returns null if key does not existgetUserParam(string $key, string $default = null
) : mixed
string
string
Default value to use if key not found
mixed
getUserParams() : array
array
has(string $key) : boolean
string
boolean
isDelete() : boolean
boolean
isDispatched() : boolean
boolean
isFlashRequest() : boolean
boolean
isGet() : boolean
boolean
isHead() : boolean
boolean
isOptions() : boolean
boolean
isPatch() : boolean
boolean
isPost() : boolean
boolean
isPut() : boolean
boolean
isSecure() : boolean
boolean
isXmlHttpRequest() : boolean
Should work with Prototype/Script.aculo.us, possibly others.
boolean
set(string $key, mixed $value) : void
string
mixed
setActionKey(string $key) : \Zend_Controller_Request_Abstract
string
\Zend_Controller_Request_Abstract
setActionName(string $value) : \Zend_Controller_Request_Abstract
string
\Zend_Controller_Request_Abstract
setAlias(string $name, string $target) : \Zend_Controller_Request_Http
Set an alias used for key lookups. $name specifies the alias, $target specifies the actual key to use.
string
string
\Zend_Controller_Request_Http
setBasePath(string|null $basePath = null
) : \Zend_Controller_Request_Http
string
null
\Zend_Controller_Request_Http
setBaseUrl(mixed $baseUrl = null
) : \Zend_Controller_Request_Http
E.g.:
Do not use the full URI when providing the base. The following are examples of what not to use:
If no $baseUrl is provided, attempts to determine the base URL from the environment, using SCRIPT_FILENAME, SCRIPT_NAME, PHP_SELF, and ORIG_SCRIPT_NAME in its determination.
mixed
\Zend_Controller_Request_Http
setControllerKey(string $key) : \Zend_Controller_Request_Abstract
string
\Zend_Controller_Request_Abstract
setControllerName(string $value) : \Zend_Controller_Request_Abstract
string
\Zend_Controller_Request_Abstract
setDispatched(boolean $flag = true
) : \Zend_Controller_Request_Abstract
boolean
\Zend_Controller_Request_Abstract
setModuleKey(string $key) : \Zend_Controller_Request_Abstract
string
\Zend_Controller_Request_Abstract
setModuleName(string $value) : \Zend_Controller_Request_Abstract
string
\Zend_Controller_Request_Abstract
setParam(mixed $key, mixed $value) : \Zend_Controller_Request_Http
Uses $key to set a userland parameter. If $key is an alias, the actual key will be retrieved and used to set the parameter.
inherited_from | \Zend_Controller_Request_Abstract::setParam() |
---|
mixed
mixed
\Zend_Controller_Request_Http
setParam(string $key, mixed $value) : \Zend_Controller_Request_Abstract
A $value of null will unset the $key if it exists
string
mixed
\Zend_Controller_Request_Abstract
setParamSources(array $paramSources = array()
) : \Zend_Controller_Request_Http
Can be empty array, or contain one or more of '_GET' or '_POST'.
\Zend_Controller_Request_Http
setParams(array $params) : \Zend_Controller_Request_Http
Set one or more parameters. Parameters are set as userland parameters, using the keys specified in the array.
inherited_from | \Zend_Controller_Request_Abstract::setParams() |
---|
array
\Zend_Controller_Request_Http
setParams(array $array) : \Zend_Controller_Request_Abstract
Null values will unset the associated key.
array
\Zend_Controller_Request_Abstract
setPathInfo(string|null $pathInfo = null
) : \Zend_Controller_Request_Http
string
null
\Zend_Controller_Request_Http
setPost(string|array $spec, null|mixed $value = null
) : \Zend_Controller_Request_Http
string
array
null
mixed
\Zend_Controller_Request_Http
setQuery(string|array $spec, null|mixed $value = null
) : \Zend_Controller_Request_Http
string
array
null
mixed
\Zend_Controller_Request_Http
setRequestUri(string $requestUri = null
) : \Zend_Controller_Request_Http
If no request URI is passed, uses the value in $_SERVER['REQUEST_URI'], $_SERVER['HTTP_X_REWRITE_URL'], or $_SERVER['ORIG_PATH_INFO'] + $_SERVER['QUERY_STRING'].
string
\Zend_Controller_Request_Http
$_action : string
$_actionKey : string
'action'
$_aliases : array
array()
$_basePath : string
null
$_baseUrl : string
null
$_controller : string
$_controllerKey : string
'controller'
$_dispatched : boolean
false
$_module : string
$_moduleKey : string
'module'
$_paramSources : array
array('_GET', '_POST')
$_params : array
array()
inherited_from | \Zend_Controller_Request_Abstract::_params |
---|
$_params : array
array()
$_pathInfo : string
''
$_rawBody : string | false
$_requestUri : \string;
SCHEME_HTTP = 'http'
SCHEME_HTTPS = 'https'