Beispiel #1
0
 /**
  * Initializes a singleton instance of this class.
  * 
  * @return RPG_Router
  */
 public static function getInstance()
 {
     if (self::$_instance === null) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Beispiel #2
0
 /**
  * Fetches an instance of the router library, initializing if necessary.
  *
  * @param  string $controllerPath Path where controllers are located.
  * @return RPG_Router
  */
 public static function router($controllerPath = '')
 {
     if (self::$_router === null) {
         if (empty($controllerPath)) {
             throw new RPG_Exception('Controller path cannot be empty on first call to RPG::router()');
         }
         self::$_router = RPG_Router::getInstance();
         self::$_router->setControllerPath($controllerPath);
     }
     return self::$_router;
 }