Load routes from file |
Hi,
Is it possible to load routes from a specific file? For instance, I have: Module - Config - BackedRoutes.php - FrontRoutes.php (...) or something like that and I would like to load `FrontendRoutes` only for frontend app and `BackedRoutes` for the admin app. Otherwise, if I have one file `Routes` then after added it to front and backend app I can visit all routes - and it is something what I want to eliminate. The same problem I will have with `Events` file. Did anyone have an idea how I can resolve that problem? Thanks all ![]()
If your routes are in a module they will be searched for and loaded.
loaded. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I know and I have it now. I understand that will be discovered and loaded automatically.
I have one module responsible for the frontend and backend part and all necessary routes currently I have in `Routes.php`. My goal is to separate frontend routes from backend routes for that one module.
And if you use this code in the Config/Routes.php file
Add its to 14 line PHP Code: $request = new Request(new \Config\App); PHP Code: use CodeIgniter\HTTP\Request;
Thx. Great, that makes sense
(04-02-2020, 02:26 PM)FoLez Wrote: And if you use this code in the Config/Routes.php file |
Welcome Guest, Not a member yet? Register Sign In |