API_Route::route PHP Method

route() public static method

Create Route
public static route ( string $url, callable $callback, string $method = "GLOBAL" ) : boolean
$url string
$callback callable
$method string
return boolean
    public static function route($url, $callback, $method = "GLOBAL")
    {
        //if (@preg_match($url, null) === false) {
        // Test if string is not regex
        $urlArray = explode("/", $url);
        if (count($urlArray) < 0) {
            return false;
        }
        if ($urlArray[0] == "" && count($urlArray) > 1) {
            array_shift($urlArray);
        }
        //if ($method == "GLOBAL") var_dump($urlArray);
        return self::buildTree(0, $urlArray, self::$_ruleTree[$method], $callback);
        //} else {
        //	return self::buildRegExpList($url, self::$_regExList[$method], $callback);
        //}
    }