Handles the inbound request passing data from the distributor to the controller. mvcRequest is a static class that wraps baseSet and is populated by the mvcDistributorBase class.
mvcRequest is then used within mvcControllers and Views to fetch additional information about the request.
The requested mime-type and output format are held within the request object.
Please note: mvcRequest does not encapsulate _POST, _GET, _REQUEST or _COOKIE. Access into these arrays should be handled via the utilityInputManager that uses the PHP filter extension.
private __construct()
Returns new mvcRequest instance
public static getInstance()
Returns an instance of mvcRequest
public initialise()
Initialises the request
public setFileType()
Figures out the format the response should be sent in
This method handles checking for an override. This occurs first, before a more generic URI check. Overrides are formatted as: /as.xml Any valid output type can be used as an override - however there may not be a template for that type.
public isXhtmlMobile()
Returns true if mobile headers suggest XHTML support
public isAjaxRequest()
Returns true if the current request is an ajax request
public getLocale()
Returns the set locale for this request
If no locale has been set yet, it will be detected. Detection operates on various fallbacks starting with a _COOKIE value of 'locale', then _SESSION param of 'locale', any request var named 'lang', the URI string for the beginning component and finally the registry value is fetched if any of the above fail or are not valid locales.
public setLocale([$inLocale = null])
Sets the locale for this request, if $inLocale is null attempts this automatically
Detection operates on various fallbacks starting with a _COOKIE value of 'locale', then _SESSION param of 'locale', any request var named 'lang', the URI string for the beginning component and finally the registry value is fetched if any of the above fail or are not valid locales.
public getLocaleSource()
Returns the locale source
public getOutputType()
Get the output type for this request
public getMimeType()
Returns the mime-type to be used with the output type
public setOutputType($inType)
Set output type (and hence mime type)
public getSession()
Returns the current requests session
public setSession($inSession)
Sets the request session
public getDistributor()
Returns the distributor for this request
public setDistributor($inDistributor)
Set main distributor for this request
public getDistributorServerName()
Returns the distributor server name for this request
Note: do not confuse Distributor Server Name with actual server name. The distributor server name is how the system identifies the site in the main websites folder.
public setDistributorServerName($inServerName)
Set the Distributor server name for this request
Note: do not confuse Distributor Server Name with actual server name. The distributor server name is how the system identifies the site in the main websites folder.
public getDistributorSitePath()
Returns the site path for this request
public setDistributorSitePath($inSitePath)
Set the site path for this request
public getControllerMap()
Get current request controller map
public setControllerMap($inParamValue)
Set current request controller map name to value $inParamValue
public getRequestUri()
Returns the request URI
public setRequestUri($inParamValue)
Set the request URI
public getServerName()
Returns the server name
public setServerName($inParamValue)
Set server name
public getServerAddress()
Returns the server name
public setServerAddress($inParamValue)
Set server name
public getServerPort()
Returns the server Port
public setServerPort($inParamValue)
Set server Port
public getServerProtocol()
Returns the server name
public setServerProtocol($inParamValue)
Set server name
public getServerSsl()
Returns true if the current request is over SSL
public setServerSsl($inParamValue)
Set if the request is over SSL
public getAcceptTypes()
Returns array of current accept types from connecting device (may have been overridden)
public setAcceptTypes([$inRequestTypes = null])
Set connecting device accept headers, or override is supplied (must be uni-dimensional array of mime types)
public getControllerUri()
Returns the controller URI identified in the request
public setControllerUri($inUri)
Sets the controller URI to $inUri
public getParam([$inKey = null])
Returns param named $inKey
public setParam($inKey, $inParamValue)
Set param in request object
public resetParams()
Reset param set
public getParamCount()
Return param count
Posted by: Scorpio Documentor (Writer), in MVC on 19 Nov 2009 @ 20:31
Tags: baseset, countable, iteratoraggregate, mvc, mvcrequest, traversable,
This
work is licenced under a
Creative Commons Licence.