예제 #1
0
 /**
  * Decode the url to build the current page/current page url
  */
 public static function decode_url($script_path)
 {
     $url = !empty($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
     // Store the current page
     self::$current_page = substr($url, 0, strrpos($url, '/') + 1);
     self::$current_page = self::$current_page[0] == '/' ? substr(self::$current_page, 1) : self::$current_page;
     self::$current_page = str_replace($script_path, '', self::$root_url) . self::$current_page;
     // Build the full current page url
     self::$current_page_url = self::build_url(self::$current_page, self::$params);
 }