protected function configureRoute(RouteInterface $route, $info = []) { if (isset($info['mw']) && count($info['mw']) > 1) { foreach ($info['mw'] as $mw) { $route->add($mw); } } if (!empty($info['name'])) { $route->setName($info['name']); } }
/** * Add a route * * This method registers a \Slim\Interfaces\RouteInterface object with the router. * * @param \Slim\Interfaces\RouteInterface $route The route object * @api */ public function map(RouteInterface $route) { list($groupPattern, $groupMiddleware) = $this->processGroups(); $route->setPattern($groupPattern . $route->getPattern()); $this->routes[] = $route; foreach ($groupMiddleware as $middleware) { $route->setMiddleware($middleware); } }