예제 #1
0
 /**
  * NativeArray constructor.
  * @param array $routesArray
  * @param Router $router
  * @throws Exception
  */
 public function __construct($routesArray, Router $router)
 {
     if (!is_array($routesArray)) {
         throw new Exception('NativeArray you must pass native php array to constructor');
     }
     $this->setArrayRoutes($routesArray);
     parent::__construct($this->getArrayRoutes(), $router);
 }
예제 #2
0
파일: Xml.php 프로젝트: dez-php/dez-router
 /**
  * Xml constructor.
  * @param array $routesFile
  * @param Router $router
  * @throws Exception
  */
 public function __construct($routesFile, Router $router)
 {
     if (!file_exists($routesFile)) {
         throw new Exception('Routes file not found [' . $routesFile . ']');
     }
     $this->setRoutesFile($routesFile);
     $this->parse();
     parent::__construct($this->getArrayRoutes(), $router);
 }