コード例 #1
0
ファイル: route.php プロジェクト: 0hyeah/yurivn
 /**
  * The constructor.
  * A base URL is required to prepend to compiled URL.  If a route path is not
  * specified then the default route path is assumed.
  * The route path can also be specified as integer 404 or integer 500 to use the
  * error paths respectively.
  *
  * @param string | int $route_path			- The route path to compile
  */
 public function __construct($route_path = false, $absolute_path = false)
 {
     // Ensure the default path is set for this route
     if (false === $this->_default_path) {
         throw new vB_Exception_Router('No default path has been defined for the route class');
     }
     // Get the class segment for this route type
     if (!($this->_class_segment = trim(vB_Router::getRouteSegmentFromClass(get_class($this))))) {
         throw new vB_Exception_Router('Could not get the request segment for the route class \'' . get_class($this) . '\'');
     }
     // Allow dynamic segment schemes
     $this->buildSegmentScheme();
     // Set the route path
     $this->_route_path = $this->resolveRoutePath($route_path);
     $this->_force_absolute_path = $absolute_path;
 }