/** * Adds a route to the end of the list. * * @param string $name The route's name * @param RouteInterface $route * * @return Router */ public function add($name, RouteInterface $route) { // clear it unset($this->routes[$name]); // Name the route $route->setDefault("_name", $name); // and Router $route->setDefault("_router", $this); // add it to the bottom of the list $this->routes[$name] = $route; return $this; }