_root = Container::get("ROOT"); $this->init(); } public function run() { $this->_router->run(); } private function init() { $this->_router = new RouterRouter(); $this->loadFromFile($this->_root . DIRECTORY_SEPARATOR . "routes"); $this->_router->set404("404 - Not found"); } private function loadFromFile($path) { if (is_dir($path)) { $router = $this->_router; require $path . DIRECTORY_SEPARATOR . "routes.php"; } } }