/** * Adds a route to the current route list. * @param string $path The path for this route. * @param string $controller The controller the route runs. * @param boolean $tokenNeeded Whether or not a token is necessary. */ public static function set($path, $controller, $tokenNeeded = true) { $path = self::fixPath($path); $controller = strtolower($controller); $keyToUse = $controller; $i = 1; while (key_exists($keyToUse, self::$routes)) { $keyToUse = $controller . '_' . $i; $i++; } $route = new Route($path, $controller); $route->setTokenNeeded($tokenNeeded); self::$routes[$keyToUse] = $route; }