Beispiel #1
0
            $url = $pageURL;
        } elseif ($path == L_URL) {
            $url = L_URL;
        } elseif (!preg_match("/http/", $path) || $parts['host'] != $_SERVER['HTTP_HOST']) {
            if (!defined("APP_DIR") || substr($orPath, 0, 1) == "/") {
                $url = L_URL . "/{$path}";
            } else {
                $url = \Lobby\App::u($orPath);
            }
        }
        return $url;
    }
    /**
     * Get the current page
     */
    public static function curPage($page = false, $full = false)
    {
        $url = self::u("", true);
        $parts = parse_url($url);
        if ($page) {
            $pathParts = explode("/", $parts['path']);
            $last = $pathParts[count($pathParts) - 1];
            // Get the string after last "/"
            return $full === false ? $last : $last . (isset($parts['query']) ? $parts['query'] : "");
        } else {
            return $full === false ? $parts['path'] : $_SERVER["REQUEST_URI"];
        }
    }
}
\Lobby::init();