Controllers

The controller in dmBridge is the point of entry into the execution of the application. The job of the controller is to coordinate various application layers to produce a given result based on user input. Different controllers are invoked depending on the current URI route. (See Figure 2.2, “Example of results view in the dmBridge MVC architecture” for an illustration of Model-View-Controller.)

Just as it is not possible to override built-in URI routes, it is not possible to override built-in controllers. However, custom controllers can be created that will respond to custom routes. Once a new URI route is established, dmBridge will attempt to invoke the controller method it specifies when a request is received for a URI matching that route. Custom controller classes should inherit from DMAbstractController, except for Control Panel controllers, which should inherit from DMCPAdminController. Control Panel controller methods should also call $this->preFlightCheck() before doing anything else.