/** * Initializes Route. */ public static function init() { self::$query = $_SERVER['REQUEST_URI']; // $_SERVER['REQUEST_URI'] contains the full URL of the page $dir = self::getDir(); if ($dir != '/') { self::$query = str_replace($dir, '', $_SERVER['REQUEST_URI']); } // Cleansing self::$query = ltrim(self::$query, '/'); self::$query = str_replace(array('index.php', 'index.html'), '', self::$query); // Extract query string $split_query = explode('?', self::$query); if (count($split_query) > 1) { self::$query = $split_query[0]; self::$queryString = $split_query[1]; } }