BootstrapRouter implements BootstrapRouterInterface
This class handles the routing for actions. Router will always first search for theme & mode files and revert to action main level if they are missing and finally to default Controller.php, View.php & Models.php. When creating actions and themes, make sure that the routes are defined correctly, any misdefined route will cause an error.Action modes are defined in the action's web configuration (and need to be set in the form file).If action has permanent route active, it will use that. Permanent routes are saved into session, so if your action is stuck on a wrong route, you can use the debug action to clear all session values to clear the routes also. There is also a controller method for clearing action's routes called $this->flushActionRoutes();Class BootstrapRouter
|$view||namespace||The view instance. Views are passed the data returned from the controller and are responsible for generating the layout data.|
|$model||namespace||The model instance. Models are responsible for querying and storing data but also provide useful utility methods for sessions, variables and validation.|
|$menuid||var||The current menu id if set|
|$view_name||var||The current view name|
|$controller||var||The controller instance|
Check whether controller class exists
Controller routing logic: 1. look for active route inside the theme2. look for active route on the main level3. look for mode inside the the theme4. look for mode inside the main level5. look for default controller inside the theme6. look for default controller on the main level
Get component class path. This class provides access to the module’s components.
Get path to the currently called action’s module.
Get path to the currently called view. View name is passed from the controller returned data.
|$class||class hierarchy coming from ArticleFactory|
If current routing is marked to be persistent and is not overriden by the current menu call, we will use the currently active route
Call the controller method if it exists, else call the default one. It returns the view name that should be called and data that should be passed to it.