Yaf_Request_Simple
class Yaf_Request_Simple extends Yaf_Request_Abstract (View source)
Yaf_Request_Simple is particularly used for test purpose. ie. simulate a spacial request under CLI mode.
Constants
SCHEME_HTTP |
|
SCHEME_HTTPS |
|
Properties
string | $module | from Yaf_Request_Abstract | |
string | $controller | from Yaf_Request_Abstract | |
string | $action | from Yaf_Request_Abstract | |
string | $method | from Yaf_Request_Abstract | |
protected array | $params | from Yaf_Request_Abstract | |
protected string | $language | from Yaf_Request_Abstract | |
protected Yaf_Exception | $_exception | from Yaf_Request_Abstract | |
protected string | $_base_uri | from Yaf_Request_Abstract | |
protected string | $uri | from Yaf_Request_Abstract | |
protected string | $dispatched | from Yaf_Request_Abstract | |
protected string | $routed | from Yaf_Request_Abstract |
Methods
Check the request whether it is a Ajax Request
Retrieve $_SERVER variable
Retrieve $_ENV variable
No description
No description
No description
No description
Set base URI, base URI is used when doing routing, in routing phase request URI is used to route a request, while base URI is used to skip the leading part(base URI) of request URI. That is, if comes a request with request URI a/b/c, then if you set base URI to "a/b", only "/c" will be used in routing phase.
Note:
generally, you don't need to set this, Yaf will determine it automatically.
Set request as dispatched
Set request as routed
No description
No description
No description
Details
bool
isGet()
No description
bool
isDelete()
No description
bool
isPatch()
No description
string|null
getRaw()
No description
Yaf_Request_Abstract|null
clearParams()
No description
bool
isPost()
No description
bool
isPut()
No description
bool
isHead()
No description
bool
isOptions()
No description
bool
isCli()
No description
final bool
isDispatched()
No description
final bool
isRouted()
No description
bool
isXmlHttpRequest()
Check the request whether it is a Ajax Request
Note:
This method depends on the request header: HTTP_X_REQUESTED_WITH, some Javascript library doesn't set this header while doing Ajax request
mixed
getServer(string $name = null, string $default = null)
Retrieve $_SERVER variable
mixed
getEnv(string $name = null, string $default = null)
Retrieve $_ENV variable
mixed
getParam(string $name, mixed $default = '')
No description
array
getParams()
No description
Yaf_Exception
getException()
No description
string
getModuleName()
No description
string
getControllerName()
No description
string
getActionName()
No description
Yaf_Request_Abstract|bool|null
setParam(string|array $name, string $value = null)
No description
Yaf_Request_Abstract|bool
setModuleName(string $module, bool $format_name = true)
No description
Yaf_Request_Abstract|bool
setControllerName(string $controller, bool $format_name = true)
No description
Yaf_Request_Abstract|bool
setActionName(string $action, bool $format_name = true)
No description
string
getMethod()
No description
string
getLanguage()
No description
bool
setBaseUri(string $uri)
Set base URI, base URI is used when doing routing, in routing phase request URI is used to route a request, while base URI is used to skip the leading part(base URI) of request URI. That is, if comes a request with request URI a/b/c, then if you set base URI to "a/b", only "/c" will be used in routing phase.
Note:
generally, you don't need to set this, Yaf will determine it automatically.
string
getBaseUri()
No description
string
getRequestUri()
No description
Yaf_Request_Abstract|null
setRequestUri(string $uri)
No description
final Yaf_Request_Abstract|null
setDispatched(bool $dispatched = null)
Set request as dispatched
final Yaf_Request_Abstract|null
setRouted(bool $flag = null)
Set request as routed
mixed
get(string $name = null, mixed $default = null)
No description
mixed
getFiles(string $name = null, mixed $default = null)
No description
mixed
getCookie(string $name = null, mixed $default = null)
No description
mixed
getPost(string $name = '', mixed $default = null)
No description
mixed
getRequest(string $name = null, mixed $default = null)
No description
mixed
getQuery(string $name = null, mixed $default = null)
No description
__construct(string $method = '', string $module = '', string $controller = '', string $action = '', array $params = null)
No description