Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function map($method, $path, $handler)
 {
     $path = $path === '/' ? $this->prefix : $this->prefix . sprintf('/%s', ltrim($path, '/'));
     $route = $this->collection->map($method, $path, $handler);
     $route->setParentGroup($this);
     if ($host = $this->getHost()) {
         $route->setHost($host);
     }
     if ($scheme = $this->getScheme()) {
         $route->setScheme($scheme);
     }
     return $route;
 }
Ejemplo n.º 2
0
 /** @inheritdoc */
 public function dispatch(IServerRequest $request, IResponse $response)
 {
     $this->discoverRoutes();
     return $this->routes->dispatch($request, $response);
 }