RequestHandlerComponent Class Reference

Inheritance diagram for RequestHandlerComponent:

Object

List of all members.


Public Member Functions

 accepts ($type=null)
 getAjaxVersion ()
 getClientIP ()
 getReferrer ()
 isAjax ()
 isAtom ()
 isDelete ()
 isGet ()
 isMobile ()
 isPost ()
 isPut ()
 isRss ()
 isXml ()
 prefers ($type=null)
 setAjax (&$controller)
 setContent ($name, $type)
 startup (&$controller)
 stripAll ($str)
 stripImages ($str)
 stripScripts ($str)
 stripTags ()
 stripWhitespace ($str)

Public Attributes

 $ajaxLayout = 'ajax'
 $controller = true
 $disableStartup = false

Detailed Description

Definition at line 40 of file request_handler.php.


Member Function Documentation

RequestHandlerComponent::accepts ( type = null  ) 

Determines which content types the client accepts

Parameters:
mixed $type Can be null (or no parameter), a string type name, or an array of types
Returns:
mixed If null or no parameter is passed, returns an array of content types the client accepts. If a string is passed, returns true if the client accepts it. If an array is passed, returns true if the client accepts one or more elements in the array. public

Definition at line 364 of file request_handler.php.

Referenced by isAtom(), isRss(), and isXml().

RequestHandlerComponent::getAjaxVersion (  ) 

Gets Prototype version if call is Ajax, otherwise empty string. The Prototype library sets a special "Prototype version" HTTP header.

Returns:
string Prototype version of component making Ajax call public

Definition at line 221 of file request_handler.php.

RequestHandlerComponent::getClientIP (  ) 

Gets remote client IP

Returns:
string Client IP address public

Definition at line 260 of file request_handler.php.

RequestHandlerComponent::getReferrer (  ) 

Gets the server name from which this request was referred

Returns:
string Server address public

Definition at line 244 of file request_handler.php.

RequestHandlerComponent::isAjax (  ) 

Returns true if the current call is from Ajax, false otherwise

Returns:
bool True if call is Ajax public

Definition at line 144 of file request_handler.php.

Referenced by setAjax().

RequestHandlerComponent::isAtom (  ) 

Returns true if the current call accepts an RSS response, false otherwise

Returns:
bool True if client accepts an RSS response public

Definition at line 175 of file request_handler.php.

References accepts().

RequestHandlerComponent::isDelete (  ) 

Returns true if the current call a DELETE request

Returns:
bool True if call is a DELETE public

Definition at line 211 of file request_handler.php.

RequestHandlerComponent::isGet (  ) 

Returns true if the current call a GET request

Returns:
bool True if call is a GET public

Definition at line 202 of file request_handler.php.

RequestHandlerComponent::isMobile (  ) 

Returns true if user agent string matches a mobile web browser

Returns:
bool True if user agent is a mobile web browser public

Definition at line 286 of file request_handler.php.

RequestHandlerComponent::isPost (  ) 

Returns true if the current call a POST request

Returns:
bool True if call is a POST public

Definition at line 184 of file request_handler.php.

RequestHandlerComponent::isPut (  ) 

Returns true if the current call a PUT request

Returns:
bool True if call is a PUT public

Definition at line 193 of file request_handler.php.

RequestHandlerComponent::isRss (  ) 

Returns true if the current call accepts an RSS response, false otherwise

Returns:
bool True if client accepts an RSS response public

Definition at line 166 of file request_handler.php.

References accepts().

RequestHandlerComponent::isXml (  ) 

Returns true if the current call accepts an XML response, false otherwise

Returns:
bool True if client accepts an XML response public

Definition at line 157 of file request_handler.php.

References accepts().

RequestHandlerComponent::prefers ( type = null  ) 

Determines which content types the client prefers

Parameters:
mixed $type
Returns:
mixed public

Definition at line 406 of file request_handler.php.

RequestHandlerComponent::setAjax ( &$  controller  ) 

Sets a controller's layout based on whether or not the current call is Ajax

Add UTF-8 header for IE6 on XPsp2 bug if RequestHandlerComponent::isAjax()

Parameters:
object The controller object
Returns:
null public

Definition at line 131 of file request_handler.php.

References $controller, and isAjax().

Referenced by startup().

RequestHandlerComponent::setContent ( name,
type 
)

Adds/sets the Content-type(s) for the given name

Parameters:
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
Returns:
void public

Definition at line 235 of file request_handler.php.

RequestHandlerComponent::startup ( &$  controller  ) 

Startup

Parameters:
object A reference to the controller
Returns:
null public

Definition at line 116 of file request_handler.php.

References $controller, and setAjax().

RequestHandlerComponent::stripAll ( str  ) 

Strips extra whitespace, images, scripts and stylesheets from output

Parameters:
string $str
Returns:
string public

Definition at line 330 of file request_handler.php.

References stripImages(), stripScripts(), and stripWhitespace().

RequestHandlerComponent::stripImages ( str  ) 

Strips image tags from output

Parameters:
string $str
Returns:
string public

Definition at line 307 of file request_handler.php.

Referenced by stripAll().

RequestHandlerComponent::stripScripts ( str  ) 

Strips scripts and stylesheets from output

Parameters:
string $str
Returns:
string public

Definition at line 320 of file request_handler.php.

Referenced by stripAll().

RequestHandlerComponent::stripTags (  ) 

Strips the specified tags from output

Returns:
string public

Definition at line 342 of file request_handler.php.

RequestHandlerComponent::stripWhitespace ( str  ) 

Strips extra whitespace from output

Parameters:
string $str
Returns:
string public

Definition at line 296 of file request_handler.php.

Referenced by stripAll().


Member Data Documentation

RequestHandlerComponent::$ajaxLayout = 'ajax'

Definition at line 55 of file request_handler.php.

RequestHandlerComponent::$controller = true

Definition at line 47 of file request_handler.php.

Referenced by setAjax(), and startup().

RequestHandlerComponent::$disableStartup = false

Definition at line 62 of file request_handler.php.


The documentation for this class was generated from the following file: