コード例 #1
0
ファイル: NativeArray.php プロジェクト: dez-php/dez-router
 /**
  * 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);
 }