/** * Load Routes from routes file * * Important: loadRoutes must be called after Router instantiation to avoid cyclic search for a Router * Instance. */ public function loadRoutes() { $file = $this->application->appPath() . '/Routes/routes.php'; $file = $this->application->getConfig()->get('router.routesFilePath', $file); if (is_readable($file)) { require $file; } $files = $this->application->getConfig()->get('router.routesFiles', []); foreach ($files as $index => $file) { if (is_readable($file)) { require $file; } } }