/** * Add a route object to the router * @param \Slim\Route $route The Slim Route */ public function map(\Slim\Route $route) { list($groupPattern, $groupMiddleware) = $this->processGroups(); $route->setPattern($groupPattern . $route->getPattern()); $this->routes[] = $route; foreach ($groupMiddleware as $middleware) { $route->setMiddleware($middleware); } }
/** * Check if the given url should be skipped or not * * @param string $url The url to test * @return boolean True if it is register as skipped, false in other cases */ public function isSkip($url) { // We need slim route for testing purpose $route = new \Slim\Route('', function () { }); foreach ($this->skip as $skipped) { // We set the path we want to try $route->setPattern($skipped); if ($route->matches($url)) { return true; } } return false; }