Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 protected function getActionName(Request $request, $name)
 {
     if ($name !== strtolower($name)) {
         throw new HttpNotFoundException('The action name must contain only lowercase letters');
     }
     return strtolower($request->getMethod()) . StringUtils::toUpperCamelcase($name);
 }
Exemplo n.º 2
0
 /**
  * Returns the fully qualified controller class.
  *
  * @param string $name The fragment of controller name.
  * @return string
  * @throws HttpException
  */
 protected function getController($name)
 {
     if ($name !== strtolower($name)) {
         throw new HttpNotFoundException('The controller name must contain only lowercase letters.');
     }
     $controller = sprintf('%s\\%sController', $this->namespace, StringUtils::toUpperCamelcase($name));
     if (!class_exists($controller, true)) {
         throw new HttpNotFoundException(sprintf('Controller "%s" can not be found.', $controller));
     }
     return $controller;
 }