public static function getMethodFromAction($action) { $method = str_replace(['.', '-', '_'], ' ', $action); $method = ucwords($method); $method = str_replace(' ', '', $method); $method = lcfirst($method); $method .= 'Action'; return $method; }
/** * @return type */ public function getMethodName() { if (!$this->methodName) { $action = $this->getRouteMatch()->getParam('action', 'not-found'); $this->setMethodName(AbstractController::getMethodFromAction($action)); } return $this->methodName; }