protected function getAction($controller, $impliedActions)
 {
     if (is_string($impliedActions)) {
         $impliedActions = array($impliedActions);
     }
     if (array_key_exists("action", $this->model->routed)) {
         $impliedActions[] = $this->model->routed['action'];
     }
     $impliedActions[] = "show";
     $impliedActions[] = "noActionMatch";
     foreach ($impliedActions as $method) {
         $method = lcfirst(Inflector::camelize(str_replace("-", "_", $method)));
         if (method_exists($controller, $method)) {
             return $method;
         }
     }
     return "";
 }
Example #2
0
 /**
  * Formats the action based on the router's match
  * @param  string $action
  * @return string
  */
 private function getActionFromParam($action)
 {
     $action = str_replace("-", "_", $action);
     if (substr($action, -1) === "/") {
         $action = substr($action, 0, -1);
     }
     return lcfirst(Inflector::camelize($action));
 }