예제 #1
0
파일: Router.php 프로젝트: Calmacil/Mf
 /**
  * Instanciator for the singleton
  *
  * @param string $route_file
  * @param Application $app;
  * @return Router
  */
 public static function getInstance($route_file = null, $app = null)
 {
     if (!self::$_instance) {
         if (!$app) {
             throw new \Exception("Router needs an Application instance to be initialized.");
         }
         self::$_instance = new Router($app);
         if ($route_file) {
             self::$_instance->load($route_file);
         }
     }
     return self::$_instance;
 }