コード例 #1
0
 /**
  * Process the route of current request
  *
  * @param Application $application
  */
 protected function processRoute(Application $application)
 {
     $route = $this->routes->findRouteFor($application->getRequest()->getRequestedPath());
     $route->process($application);
 }
コード例 #2
0
ファイル: Filter.php プロジェクト: lcobucci/action-mapper
 /**
  * Returns a service from the dependency injection container
  *
  * @param string $serviceId
  * @return mixed
  *
  * @deprecated Use explicity injection
  */
 public function get($serviceId)
 {
     return $this->application->getDependencyContainer()->get($serviceId);
 }
コード例 #3
0
ファイル: Controller.php プロジェクト: lcobucci/action-mapper
 /**
  * Redirect to another path
  *
  * @param string $url
  */
 public function redirect($url)
 {
     $this->application->redirect($url);
 }
コード例 #4
0
 /**
  * Parses the class annotations
  *
  * @param Route $handler
  * @param Application $application
  *
  * @return mixed
  *
  * @throws RuntimeException
  * @throws PageNotFoundException
  */
 protected function parseAnnotation(Route $handler, Application $application)
 {
     $class = new ReflectionClass($handler);
     foreach ($class->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
         $annotation = $this->annotationReader->getMethodAnnotation($method, '\\Lcobucci\\ActionMapper2\\Routing\\Annotation\\Route');
         if ($annotation && $annotation->match($this, $application->getRequest())) {
             return $method->invokeArgs($handler, array_merge($this->matchedArgs, (array) $annotation->getMatchedArgs()));
         }
     }
     throw new PageNotFoundException('No route for the requested path');
 }