Пример #1
0
 /**
  * gets action method
  *
  * @return string
  */
 public function getActionMethod()
 {
     $actionMethod = Util::getCamelCased($this->request->getActionName()) . 'Action';
     $actionMethod = lcfirst($actionMethod);
     return $actionMethod;
 }
Пример #2
0
 /**
  * gets controller path
  *
  * @param   string  $moduleName
  * @param   string  $controllerName
  * @return  string
  *
  * @throws  HttpKernelException if controller directory is not a directory
  */
 public function getControllerPath($moduleName, $controllerName)
 {
     $moduleNameCamelCased = Util::getCamelCased($moduleName);
     if (!in_array($moduleNameCamelCased, $this->modules, true)) {
         throw new HttpKernelException("Module '{$moduleNameCamelCased}' is not defined!");
     }
     $params = array('controller' => $controllerName, 'module' => $moduleName);
     $controllerDir = Util::parsePattern($this->controllerPathPattern, $params);
     if (!is_dir($controllerDir)) {
         $controllerNameCamelCased = Util::getCamelCased($controllerName);
         throw new HttpKernelException("Controller path for module '{$moduleNameCamelCased}' and" . " controller '{$controllerNameCamelCased}' is not defined!" . ' Expected to be: ' . $controllerDir);
     }
     return $controllerDir;
 }