/** * 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); }
/** * 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); }