コード例 #1
0
ファイル: Request.php プロジェクト: liammartens/xtend
 /**
  * Gets the path
  *
  * @return string
  */
 public static function path()
 {
     if (self::$_path === false) {
         $location = trim(App::location(), '/');
         if ($location != '' && strrpos($location, '/') != strlen($location) - 1) {
             $location .= '/';
         }
         $location = str_replace('/', '\\/', $location);
         $rx = '(?:(?:^(' . $location . ')index\\.php$)|(?:^(' . $location . ')index\\.php\\/))';
         self::$_path = preg_replace('/' . $rx . '/', '$1$2', trim($_SERVER['REQUEST_URI'], '/'));
     }
     return self::$_path;
 }
コード例 #2
0
ファイル: Router.php プロジェクト: liammartens/xtend
 /**
  * Sets a home route
  *
  * @param mixed $route
  *
  * @return xTend\Objects\Route
  */
 public static function home($route = null)
 {
     if ($route !== null) {
         //the home should always be a route not a handle or route object
         self::$_home = new Route(App::location(), $route, false);
     }
     return self::$_home;
 }