/** * {@inheritdoc} */ public function match(Request $request) { $this->router->handle($request->getUri()->getPath()); if (!$this->router->wasMatched()) { // TODO Is it worth to validate, if route matches but the method is incompatible? return RouteResult::fromRouteFailure(); } $matchedRoute = $this->router->getMatchedRoute(); return RouteResult::fromRouteMatch($matchedRoute->getName(), $this->router->getNamespaceName(), $this->collectParams($matchedRoute)); }
public function routing(Router $router) { $this->setModuleName($router->getModuleName()); $this->setNamespaceName($router->getNamespaceName()); $this->setControllerName($router->getControllerName()); $this->setActionName($router->getActionName()); $this->setParams($router->getParams()); }
public function getNamespaceName() { return parent::getNamespaceName(); }