public static function buildUrl($params) { $path = ''; if (FajrConfig::get('URL.Path')) { $path = FajrRouter::paramsToPath($params); } $query = http_build_query($params); if (strlen($query) > 0) { $query = '?' . $query; } $base = ''; if (!FajrConfig::get('URL.Rewrite')) { $base = 'index.php'; if (strlen($path) > 0) { $base .= '/'; } } return self::basePath() . $base . $path . $query; }