Skip to content

Instantly share code, notes, and snippets.

Created August 25, 2013 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6337063 to your computer and use it in GitHub Desktop.
Save anonymous/6337063 to your computer and use it in GitHub Desktop.
match pattern /$Action/$ID/$Name
array
'Action' => string 'deciding' (length=8)
'ID' => null
'Name' => null
deciding/$Action/$ID/$Name => deciding
Debug (line 251 of RequestHandler.php): Testing 'deciding/$Action/$ID/$Name' with '' on DecisionMaking_Controller
match pattern deciding/$Action/$ID/$Name$Action//$ID/$OtherID => handleAction
Debug (line 251 of RequestHandler.php): Testing '$Action//$ID/$OtherID' with '' on DecisionMaking_Controller
match pattern $Action//$ID/$OtherIDin match
Debug (line 260 of RequestHandler.php): Rule '$Action//$ID/$OtherID' matched to action 'handleAction' on DecisionMaking_Controller. Latest request params: array ( 'Action' => NULL, 'ID' => NULL, 'OtherID' => NULL, )
Debug (line 184 of RequestHandler.php): Action not set; using default action method name 'index'
rendering through index action
protected function findAction($request) {
$handlerClass = ($this->class) ? $this->class : get_class($this);
// We stop after RequestHandler; in other words, at ViewableData
while($handlerClass && $handlerClass != 'ViewableData') {
$urlHandlers = Config::inst()->get($handlerClass, 'url_handlers', Config::UNINHERITED);
if($urlHandlers) foreach($urlHandlers as $rule => $action) {
echo "$rule => $action";
if(isset($_REQUEST['debug_request'])) {
Debug::message("Testing '$rule' with '" . $request->remaining() . "' on $this->class");
}
if($request->match($rule, true)) {
echo 'in match';
if(isset($_REQUEST['debug_request'])) {
Debug::message(
"Rule '$rule' matched to action '$action' on $this->class. ".
"Latest request params: " . var_export($request->latestParams(), true)
);
}
return array('rule' => $rule, 'action' => $action);
}
}
$handlerClass = get_parent_class($handlerClass);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment