Skip to content

Commit

Permalink
Adding more documentation, and adding some return early changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 14, 2010
1 parent db3f74d commit 293ef95
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cake/libs/dispatcher.php
Expand Up @@ -157,7 +157,6 @@ protected function _invoke(Controller $controller, CakeRequest $request) {

$methods = array_flip($controller->methods);


if (!isset($methods[$request->params['action']])) {
if ($controller->scaffold !== false) {
App::import('Controller', 'Scaffold', false);
Expand Down Expand Up @@ -185,10 +184,13 @@ protected function _invoke(Controller $controller, CakeRequest $request) {
}

/**
* Returns array of GET and POST parameters. GET parameters are taken from given URL.
* Applies Routing and additionalParameters to the request to be dispatched.
* If Routes have not been loaded they will be loaded, and app/config/routes.php will be run.
*
* @param CakeRequest $fromUrl CakeRequest object to mine for parameter information.
* @return array Parameters found in POST and GET.
* @param CakeRequest $request CakeRequest object to mine for parameter information.
* @param array $additionalParams An array of additional parameters to set to the request.
* Useful when Object::requestAction() is involved
* @return CakeRequest The request object with routing params set.
*/
public function parseParams(CakeRequest $request, $additionalParams = array()) {
if (count(Router::$routes) > 0) {
Expand All @@ -213,16 +215,14 @@ public function parseParams(CakeRequest $request, $additionalParams = array()) {
* @return mixed name of controller if not loaded, or object if loaded
*/
protected function _getController($request) {
$controller = false;
$ctrlClass = $this->_loadController($request);
if (!$ctrlClass) {
return $controller;
return false;
}
$ctrlClass .= 'Controller';
if (class_exists($ctrlClass)) {
$controller = new $ctrlClass($request);
return new $ctrlClass($request);
}
return $controller;
}

/**
Expand Down

0 comments on commit 293ef95

Please sign in to comment.