Dispatcher Class Reference

Public Member Functions | |
| _invoke (&$controller, $params, $missingAction=false) | |
| _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 42 of file dispatcher.php.
Member Function Documentation
| Dispatcher::_invoke | ( | &$ | controller, | |
| $ | params, | |||
| $ | missingAction = false | |||
| ) |
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 242 of file dispatcher.php.
References $output, Inflector::camelize(), and App::import().
| 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 424 of file dispatcher.php.
References Router::getArgs().
| Dispatcher::baseUrl | ( | ) |
Returns a base URL and sets the proper webroot
- Returns:
- string Base URL public
Definition at line 364 of file dispatcher.php.
References $config, $file, 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 617 of file dispatcher.php.
References $filename, $pos, $url, env(), App::import(), Configure::read(), and Inflector::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 110 of file dispatcher.php.
References $url, Object::_stop(), baseUrl(), cached(), Object::cakeError(), Inflector::camelize(), getUrl(), params(), parseParams(), Router::prefixes(), and Router::setRequestInfo().
| 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 567 of file dispatcher.php.
References $url.
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 295 of file dispatcher.php.
References $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 517 of file dispatcher.php.
References env(), and Configure::read().
Member Data Documentation
| Dispatcher::$admin = false |
Definition at line 70 of file dispatcher.php.
| Dispatcher::$base = false |
Definition at line 49 of file dispatcher.php.
| Dispatcher::$here = false |
Definition at line 63 of file dispatcher.php.
| Dispatcher::$params = null |
Definition at line 84 of file dispatcher.php.
| Dispatcher::$plugin = null |
Definition at line 77 of file dispatcher.php.
| Dispatcher::$webroot = '/' |
Definition at line 56 of file dispatcher.php.
The documentation for this class was generated from the following file:
- 1.2.x.x/cake/dispatcher.php