ZMObject
└─ZMRequest
public class ZMRequest
extends ZMObject
| Field Summary | |
|---|---|
| final str | Paramter name containing the request id. |
| final str | Name of the session token form field and also the name in the session. |
| Fields inherited from org.zenmagick.core.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
ZMRequest(array parameter) Create new instance. |
|
| Method Summary | |
|---|---|
| string | Get the URL context for this request. |
| ZMController | Get the controller for this request. |
| strng | Get the hostname for this request. |
| string | Get the request method. |
| mixed | getParameter(string name, mixed default, boolean sanitize) Generic access method for request parameter. |
| array | getParameterMap(boolean sanitize) Get the complete parameter map. |
| string | Get the full query string. |
| string | Get the request id. |
| ZMSession | Get the current session. |
| string | getSticky(boolean clear) Check if a sticky url exists that should be loaded (after a login). |
| string | Get the template path. |
| ZMToolbox | Get the toolbox for this request. |
| static void | instance() Get instance. |
| boolean | isSecure() Checks if the current request is secure or note. |
| void | Mark this request as the actually requested URL. |
| void | redirect(string url, int status) Redirect to the given url. |
| void | setController(ZMController controller) Set the current controller. |
| void | setMethod(string method) Set the request method. |
| mixed | setParameter(string name, mixed value) Allow programmatic manipulation of request parameters. |
| void | setParameterMap(array map) Set the parameter map. |
| void | setRequestId(string requestId) Set the request id. |
| void | setSession(ZMSession session) Set the current session instance. |
| boolean | Validate session token. |
| Methods inherited from org.zenmagick.core.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public final str REQUEST_ID = 'zmid'
Paramter name containing the request id.
The request/page id determines the page being displayed.
public final str SESSION_TOKEN_NAME = 'stoken'
Name of the session token form field and also the name in the session.
public ZMRequest(array parameter)
Create new instance.
null, $_GET and $_POST will be used.public string getContext()
Get the URL context for this request.
public ZMController getController()
Get the controller for this request.
In case the controller is not explicitely set, the method will use the url mapper
(ZMUrlManager::instance()->findController()) to determine a controller. This will then
be either a configured controller or the default controller.
public strng getHostname()
Get the hostname for this request.
public string getMethod()
Get the request method.
public mixed getParameter(string name, mixed default, boolean sanitize)
Generic access method for request parameter.
This method is evaluating both GET and POST parameter.
There is a special case for when a parameter is not found, but _[name] is found. In this
case false is returned. This allows to handle checkboxes same as any other form element
by adding a hidden field _[name] with the original value.
null is used).true, sanitze value; default is true.null.public array getParameterMap(boolean sanitize)
Get the complete parameter map.
true, sanitze value; default is true.public string getQueryString()
Get the full query string.
public string getRequestId()
Get the request id.
The request id is the main criteria for selecting the controller and view to process this request.
self::REQUEST_ID query parameter.public ZMSession getSession()
Get the current session.
public string getSticky(boolean clear)
Check if a sticky url exists that should be loaded (after a login).
true to clear.null.public string getTemplatePath()
Get the template path.
public ZMToolbox getToolbox()
Get the toolbox for this request.
public static void instance()
Get instance.
A final straw to get the shared request instance if nothing else is available.
public boolean isSecure()
Checks if the current request is secure or note.
true if the current request is secure; eg. SSL, false if not.public void markSticky()
Mark this request as the actually requested URL.
Typically this happends when a request is received without valid authority. The URL will be forwarded to, once permissions is gained (user logged in).
public void redirect(string url, int status)
Redirect to the given url.
public void setController(ZMController controller)
Set the current controller.
public void setMethod(string method)
Set the request method.
public mixed setParameter(string name, mixed value)
Allow programmatic manipulation of request parameters.
null.public void setParameterMap(array map)
Set the parameter map.
public void setRequestId(string requestId)
Set the request id.
public void setSession(ZMSession session)
Set the current session instance.
public boolean validateSessionToken()
Validate session token.
true in case the session token is valid.
A request wrapper.
NOTE: For the time of transition between static and instance usage of request methods this will have a temp. name of
ZMRequest.