NAMESPACE: Bootstrap/Router

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

public properties
$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
$new_menuid var
$actionid var
$action_id var
$view_name var The current view name
$controller var The controller instance
private function checkExistence($primary,$secondary)

Check whether controller class exists


public function getController($class)

Controller routing logic: 1. look for active route inside the theme

2. look for active route on the main level

3. look for mode inside the the theme

4. look for mode inside the main level

5. look for default controller inside the theme

6. look for default controller on the main level


public function getComponent($class)

Get component class path. This class provides access to the module’s components.


private function getMainPath()

Get path to the currently called action’s module.

public function getView($class)

Get path to the currently called view. View name is passed from the controller returned data.


$class class hierarchy coming from ArticleFactory


private function configureNames($route,$include_menuid)


private function setRoute()

If current routing is marked to be persistent and is not overriden by the current menu call, we will use the currently active route

public function prepareView()

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.