Inheritance diagram for RequestHandlerComponent:

Public Member Functions | |
| __construct () | |
| __initializeTypes () | |
| accepts ($type=null) | |
| beforeRedirect (&$controller, $url) | |
| getAjaxVersion () | |
| getClientIP ($safe=true) | |
| getReferrer () | |
| initialize (&$controller) | |
| isAjax () | |
| isAtom () | |
| isDelete () | |
| isFlash () | |
| isGet () | |
| isMobile () | |
| isPost () | |
| isPut () | |
| isRss () | |
| isSSL () | |
| isWap () | |
| isXml () | |
| mapType ($ctype) | |
| prefers ($type=null) | |
| renderAs (&$controller, $type) | |
| requestedWith ($type=null) | |
| respondAs ($type, $options=array()) | |
| responseType () | |
| setContent ($name, $type=null) | |
| startup (&$controller) | |
Public Attributes | |
| $__acceptTypes = array() | |
| $__renderType = null | |
| $__requestContent | |
| $__responseTypeSet = null | |
| $__typesInitialized = false | |
| $ajaxLayout = 'ajax' | |
| $enabled = true | |
| $ext = null | |
| $params = array() | |
Definition at line 39 of file request_handler.php.
| RequestHandlerComponent::__construct | ( | ) |
Constructor. Parses the accepted content types accepted by the client using HTTP_ACCEPT
Reimplemented from Object.
Definition at line 144 of file request_handler.php.
| RequestHandlerComponent::__initializeTypes | ( | ) |
| RequestHandlerComponent::accepts | ( | $ | type = null |
) |
Determines which content types the client accepts. Acceptance is based on the file extension parsed by the Router (if present), and by the HTTP_ACCEPT header.
| mixed | $type Can be null (or no parameter), a string type name, or an array of types |
Definition at line 438 of file request_handler.php.
| RequestHandlerComponent::beforeRedirect | ( | &$ | controller, | |
| $ | url | |||
| ) |
Handles (fakes) redirects for Ajax requests using requestAction()
| object | $controller A reference to the controller | |
| mixed | $url A string or array containing the redirect location public |
Definition at line 227 of file request_handler.php.
| RequestHandlerComponent::getAjaxVersion | ( | ) |
Gets Prototype version if call is Ajax, otherwise empty string. The Prototype library sets a special "Prototype version" HTTP header.
Definition at line 357 of file request_handler.php.
| RequestHandlerComponent::getClientIP | ( | $ | safe = true |
) |
Gets remote client IP
Definition at line 404 of file request_handler.php.
| RequestHandlerComponent::getReferrer | ( | ) |
Gets the server name from which this request was referred
Definition at line 388 of file request_handler.php.
| RequestHandlerComponent::initialize | ( | &$ | controller | ) |
Initializes the component, gets a reference to Controller::$parameters, and checks to see if a file extension has been parsed by the Router. If yes, the corresponding content-type is pushed onto the list of accepted content-types as the first item.
| object | $controller A reference to the controller |
Definition at line 166 of file request_handler.php.
| RequestHandlerComponent::isAjax | ( | ) |
Returns true if the current HTTP request is Ajax, false otherwise
Definition at line 243 of file request_handler.php.
| RequestHandlerComponent::isAtom | ( | ) |
Returns true if the current call accepts an Atom response, false otherwise
Definition at line 288 of file request_handler.php.
| RequestHandlerComponent::isDelete | ( | ) |
Returns true if the current call a DELETE request
Definition at line 347 of file request_handler.php.
| RequestHandlerComponent::isFlash | ( | ) |
Returns true if the current HTTP request is coming from a Flash-based client
Definition at line 252 of file request_handler.php.
| RequestHandlerComponent::isGet | ( | ) |
Returns true if the current call a GET request
Definition at line 338 of file request_handler.php.
| RequestHandlerComponent::isMobile | ( | ) |
Returns true if user agent string matches a mobile web browser, or if the client accepts WAP content.
Definition at line 298 of file request_handler.php.
| RequestHandlerComponent::isPost | ( | ) |
Returns true if the current call a POST request
Definition at line 320 of file request_handler.php.
| RequestHandlerComponent::isPut | ( | ) |
Returns true if the current call a PUT request
Definition at line 329 of file request_handler.php.
| RequestHandlerComponent::isRss | ( | ) |
Returns true if the current call accepts an RSS response, false otherwise
Definition at line 279 of file request_handler.php.
| RequestHandlerComponent::isSSL | ( | ) |
Returns true if the current request is over HTTPS, false otherwise.
Definition at line 261 of file request_handler.php.
| RequestHandlerComponent::isWap | ( | ) |
Returns true if the client accepts WAP content
Definition at line 311 of file request_handler.php.
| RequestHandlerComponent::isXml | ( | ) |
Returns true if the current call accepts an XML response, false otherwise
Definition at line 270 of file request_handler.php.
| RequestHandlerComponent::mapType | ( | $ | ctype | ) |
Maps a content-type back to an alias
| mixed | $type Content type |
Definition at line 696 of file request_handler.php.
| RequestHandlerComponent::prefers | ( | $ | type = null |
) |
Determines which content-types the client prefers. If no parameters are given, the content-type that the client most likely prefers is returned. If $type is an array, the first item in the array that the client accepts is returned. Preference is determined primarily by the file extension parsed by the Router if provided, and secondarily by the list of content-types provided in HTTP_ACCEPT.
| mixed | $type An optional array of 'friendly' content-type names, i.e. 'html', 'xml', 'js', etc. |
Definition at line 513 of file request_handler.php.
| RequestHandlerComponent::renderAs | ( | &$ | controller, | |
| $ | type | |||
| ) |
Sets the layout and template paths for the content type defined by $type.
| object | $controller A reference to a controller object | |
| string | $type Type of response to send (e.g: 'ajax') |
Definition at line 571 of file request_handler.php.
| RequestHandlerComponent::requestedWith | ( | $ | type = null |
) |
Determines the content type of the data the client has sent (i.e. in a POST request)
| mixed | $type Can be null (or no parameter), a string type name, or an array of types |
Definition at line 479 of file request_handler.php.
| RequestHandlerComponent::respondAs | ( | $ | type, | |
| $ | options = array() | |||
| ) |
Sets the response header based on type map index name. If DEBUG is greater than 2, the header is not set.
| mixed | $type Friendly type name, i.e. 'html' or 'xml', or a full content-type, like 'application/x-shockwave'. | |
| array | $options If $type is a friendly type name that is associated with more than one type of content, $index is used to select which content-type to use. |
Definition at line 625 of file request_handler.php.
| RequestHandlerComponent::responseType | ( | ) |
Returns the current response type (Content-type header), or null if none has been set
Definition at line 683 of file request_handler.php.
| RequestHandlerComponent::setContent | ( | $ | name, | |
| $ | type = null | |||
| ) |
Adds/sets the Content-type(s) for the given name. This method allows content-types to be mapped to friendly aliases (or extensions), which allows RequestHandler to automatically respond to requests of that type in the startup method.
| string | $name The name of the Content-type, i.e. "html", "xml", "css" | |
| mixed | $type The Content-type or array of Content-types assigned to the name, i.e. "text/html", or "application/xml" |
Definition at line 375 of file request_handler.php.
| RequestHandlerComponent::startup | ( | &$ | controller | ) |
The startup method of the RequestHandler enables several automatic behaviors related to the detection of certain properties of the HTTP request, including:
| object | $controller A reference to the controller |
Definition at line 189 of file request_handler.php.
| RequestHandlerComponent::$__acceptTypes = array() |
Definition at line 116 of file request_handler.php.
| RequestHandlerComponent::$__renderType = null |
Definition at line 123 of file request_handler.php.
| RequestHandlerComponent::$__requestContent |
Initial value:
array(
'javascript' => 'text/javascript',
'js' => 'text/javascript',
'json' => 'application/json',
'css' => 'text/css',
'html' => array('text/html', '*/*'),
'text' => 'text/plain',
'txt' => 'text/plain',
'csv' => array('application/vnd.ms-excel', 'text/plain'),
'form' => 'application/x-www-form-urlencoded',
'file' => 'multipart/form-data',
'xhtml' => array('application/xhtml+xml', 'application/xhtml', 'text/xhtml'),
'xhtml-mobile' => 'application/vnd.wap.xhtml+xml',
'xml' => array('application/xml', 'text/xml'),
'rss' => 'application/rss+xml',
'atom' => 'application/atom+xml',
'amf' => 'application/x-amf',
'wap' => array(
'text/vnd.wap.wml',
'text/vnd.wap.wmlscript',
'image/vnd.wap.wbmp'
),
'wml' => 'text/vnd.wap.wml',
'wmlscript' => 'text/vnd.wap.wmlscript',
'wbmp' => 'image/vnd.wap.wbmp',
'pdf' => 'application/pdf',
'zip' => 'application/x-zip',
'tar' => 'application/x-tar'
)
Definition at line 78 of file request_handler.php.
| RequestHandlerComponent::$__responseTypeSet = null |
Definition at line 62 of file request_handler.php.
| RequestHandlerComponent::$__typesInitialized = false |
Definition at line 139 of file request_handler.php.
| RequestHandlerComponent::$ajaxLayout = 'ajax' |
Definition at line 47 of file request_handler.php.
| RequestHandlerComponent::$enabled = true |
Definition at line 54 of file request_handler.php.
| RequestHandlerComponent::$ext = null |
Definition at line 131 of file request_handler.php.
| RequestHandlerComponent::$params = array() |
Definition at line 69 of file request_handler.php.
1.4.7