(Available since DotKernel 1.3.0)
The router.xml file stores the router settings. When talking about router settings, we mean modules, controllers (dots) and default actions. If you need other settings, feel free to update the file.
configs/router.xml has the following settings:
- controllers – the controller(dots) for each module
- route – stores the default controller for the modules and the default action for the controllers.
Note*: this file must be updated when you:
- create a new module
- create a new dots
- or change the default action of the controller
In the sample below, frontend is the module, Page is the dots and home is the action
configs/router.xml sample code:
<?xml version="1.0" encoding="utf-8"?> <router> <!-- all controllers listed here--> <!-- 1. for whitelist approach & a secure autoload of all controllers--> <controllers> <frontend>Page</frontend> <frontend>User</frontend> <admin>Admin</admin> <admin>System</admin> <admin>User</admin> <rss>Sample</rss> </controllers> <routes> <!-- default controllers for modules --> <controller> <frontend>Page</frontend> <admin>System</admin> <rss>Sample</rss> </controller> <action> <!-- default action for controllers ... --> <frontend> <Page>home</Page> <User>login</User> </frontend> <admin> <Admin>account</Admin> <System>dashboard</System> <User>list</User> </admin> </action> </routes> </router>