dmBridge PHP API
DMRoute Class Reference

Maps an incoming HTTP request to actionable information (controller, method, method parameters, etc.) in the Front Controller pattern. More...

Public Member Functions


Detailed Description

Maps an incoming HTTP request to actionable information (controller, method, method parameters, etc.) in the Front Controller pattern.

An instance of the incoming route is accessible via DMHTTPRequest::getCurrent()->getURI()->getRoute().

Author:
Alex Dolski <alex.dolski@unlv.edu> http://www.opensource.org/licenses/mit-license.php

Definition at line 18 of file DMRoute.php.


Constructor & Destructor Documentation

DMRoute::__construct ( controller,
method 
)
Parameters:
stringcontroller The controller that the action should instantiate
stringmethod The method that the action should invoke
Exceptions:
DMInvalidRouteExceptionif the specified action's controller or method are invalid (the controller or method does not exist).

Definition at line 54 of file DMRoute.php.


Member Function Documentation

DMRoute::equals ( object)
Parameters:
objectobject The object to compare
Returns:
boolean

Definition at line 135 of file DMRoute.php.

DMRoute::getAvailableRepresentations ( )
Returns:
array Associative array of URI extension => DMMediaType pairs.

Definition at line 62 of file DMRoute.php.

Referenced by getBestRepresentation().

DMRoute::getBestRepresentation ( requested_representation = null)
Parameters:
stringrequested_representation Extension of requested representation (e.g. "xml" for XML, "json" for JSON, etc.)
Returns:
string

Definition at line 84 of file DMRoute.php.

DMRoute::getController ( )
Returns:
string The name of the controller used by this route

Definition at line 120 of file DMRoute.php.

Referenced by equals(), and isValid().

DMRoute::getMethod ( )
Returns:
string The name of the controller method to invoke

Definition at line 150 of file DMRoute.php.

Referenced by equals(), and isValid().

DMRoute::getParameters ( )
Returns:
Comma-delimited string

Definition at line 178 of file DMRoute.php.

Referenced by equals().

DMRoute::isModuleRoute ( )
Returns:
boolean

Definition at line 164 of file DMRoute.php.

DMRoute::isValid ( )
Returns:
boolean True if the route can be mapped to a controller method; false if not.

Definition at line 193 of file DMRoute.php.

DMRoute::setAvailableRepresentations ( array $  representations)
Parameters:
arrayrepresentations Array of DMMediaTypes

Definition at line 75 of file DMRoute.php.

DMRoute::setController ( name)
Parameters:
stringname

Definition at line 127 of file DMRoute.php.

Referenced by __construct().

DMRoute::setMethod ( method)
Parameters:
methodThe name of the controller method to invoke

Definition at line 157 of file DMRoute.php.

Referenced by __construct().

DMRoute::setModuleRoute ( bool)
Parameters:
booleanbool

Definition at line 171 of file DMRoute.php.

DMRoute::setParameters ( params)
Parameters:
paramsComma-delimited string

Definition at line 185 of file DMRoute.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables