Dispatcher Class Reference

Inheritance diagram for Dispatcher:

Object List of all members.

Public Member Functions

 __construct ($url=null, $base=false)
 __extractParams ($url, $additionalParams=array())
__getController ($params=null)
 __loadController ($params)
 _invoke (&$controller, $params)
 _restructureParams ($params, $reverse=false)
 baseUrl ()
 cached ($url)
 dispatch ($url=null, $additionalParams=array())
 getUrl ($uri=null, $base=null)
 parseParams ($fromUrl)
 uri ()

Public Attributes

 $admin = false
 $base = false
 $here = false
 $params = null
 $plugin = null
 $webroot = '/'

Detailed Description

Definition at line 40 of file dispatcher.php.


Constructor & Destructor Documentation

Dispatcher::__construct ( url = null,
base = false 
)

Constructor.

Definition at line 86 of file dispatcher.php.

References $base, $url, dispatch(), and Configure::write().


Member Function Documentation

Dispatcher::__extractParams ( url,
additionalParams = array() 
)

Sets the params when $url is passed as an array to Object::requestAction();

Parameters:
array $url
array $additionalParams
Returns:
string $url private

Definition at line 250 of file dispatcher.php.

References $url, params(), and Router::url().

Referenced by dispatch().

& Dispatcher::__getController ( params = null  ) 

Get controller to use, either plugin controller or application controller

Parameters:
array $params Array of parameters
Returns:
mixed name of controller if not loaded, or object if loaded private

Definition at line 422 of file dispatcher.php.

References $params, __loadController(), _restructureParams(), and params().

Referenced by dispatch().

Dispatcher::__loadController ( params  ) 

Load controller and return controller class

Parameters:
array $params Array of parameters
Returns:
string|bool Name of controller class name private

Definition at line 464 of file dispatcher.php.

References $params, camelize(), App::import(), and params().

Referenced by __getController().

Dispatcher::_invoke ( &$  controller,
params 
)

Invokes given controller's render action if autoRender option is set. Otherwise the contents of the operation are returned as a string.

Parameters:
object $controller Controller to invoke
array $params Parameters with at least the 'action' to invoke
boolean $missingAction Set to true if missing action should be rendered, false otherwise
Returns:
string Output as sent by controller protected

Definition at line 206 of file dispatcher.php.

References $output, $params, Object::cakeError(), camelize(), and App::import().

Referenced by dispatch().

Dispatcher::_restructureParams ( params,
reverse = false 
)

Restructure params in case we're serving a plugin.

Parameters:
array $params Array on where to re-set 'controller', 'action', and 'pass' indexes
boolean $reverse
Returns:
array Restructured array protected

Definition at line 393 of file dispatcher.php.

References $params, and Router::getArgs().

Referenced by __getController().

Dispatcher::baseUrl (  ) 

Returns a base URL and sets the proper webroot

Returns:
string Base URL public

Definition at line 334 of file dispatcher.php.

References $base, $config, $webroot, env(), and Configure::read().

Referenced by dispatch().

Dispatcher::cached ( url  ) 

Outputs cached dispatch for js, css, img, view cache

Parameters:
string $url Requested URL public

Definition at line 585 of file dispatcher.php.

References $filename, $path, $plugin, $url, Object::_stop(), env(), App::import(), Configure::read(), and slug().

Referenced by dispatch().

Dispatcher::dispatch ( url = null,
additionalParams = array() 
)

Dispatches and invokes given URL, handing over control to the involved controllers, and then renders the results (if autoRender is set).

If no controller of given name can be found, invoke() shows error messages in the form of Missing Controllers information. It does the same with Actions (methods of Controllers are called Actions).

Parameters:
string $url URL information to work on
array $additionalParams Settings array ("bare", "return") which is melded with the GET and POST params
Returns:
boolean Success public

Definition at line 106 of file dispatcher.php.

References $url, __extractParams(), __getController(), _invoke(), Object::_stop(), baseUrl(), cached(), Object::cakeError(), camelize(), getUrl(), params(), parseParams(), Router::prefixes(), and Router::setRequestInfo().

Referenced by __construct().

Dispatcher::getUrl ( uri = null,
base = null 
)

Returns and sets the $_GET[url] derived from the REQUEST_URI

Parameters:
string $uri Request URI
string $base Base path
Returns:
string URL public

Definition at line 537 of file dispatcher.php.

References $base, $url, and uri().

Referenced by dispatch().

Dispatcher::parseParams ( fromUrl  ) 

Returns array of GET and POST parameters. GET parameters are taken from given URL.

Parameters:
string $fromUrl URL to mine for parameter information.
Returns:
array Parameters found in POST and GET. public

Definition at line 262 of file dispatcher.php.

References $params, $url, env(), Router::getNamedExpressions(), Router::parse(), Router::stripEscape(), and stripslashes_deep().

Referenced by dispatch().

Dispatcher::uri (  ) 

Returns the REQUEST_URI from the server environment, or, failing that, constructs a new one, using the PHP_SELF constant and other variables.

Returns:
string URI public

Definition at line 491 of file dispatcher.php.

References $base, and env().

Referenced by getUrl().


Member Data Documentation

Dispatcher::$admin = false

Definition at line 68 of file dispatcher.php.

Dispatcher::$base = false

Definition at line 47 of file dispatcher.php.

Referenced by __construct(), baseUrl(), getUrl(), and uri().

Dispatcher::$here = false

Definition at line 61 of file dispatcher.php.

Dispatcher::$params = null

Definition at line 82 of file dispatcher.php.

Referenced by __getController(), __loadController(), _invoke(), _restructureParams(), and parseParams().

Dispatcher::$plugin = null

Definition at line 75 of file dispatcher.php.

Referenced by cached().

Dispatcher::$webroot = '/'

Definition at line 54 of file dispatcher.php.

Referenced by baseUrl().


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:56 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7