RoutedController Summary The abstract class for controllers associated with a route. Description The RoutedController abstract class is the abstract base class for controllers that are associated with a route in Altitude MVC/MVP applications. Examples Basic Usage 12345678910111213141516171819202122232425262728293031323334import Altitude.Frontend;import Altitude.Frontend.RouteEngines; external $; class CustomersController : RoutedController{ Views.Customers view = new Views.Customers(); Models.Customers model = new Models.Customers(); public override void registerRoute(IRouter router) { router.registerRoute("customers", this.view.show, this.view.hide); } public override void attachViews() { this.model.attach(this.view); } public override void listenEvents() { $(".customers").click(function() { // ... }); }} // Instantiate a WebBrowserRouter for browser-based routingWebBrowserRouter router = new WebBrowserRouter();router.listenEvents(); // Instantiate the controller and register the routeCustomersController customersController = new CustomersController();customersController.attachViews(); // Do not do this in your testscustomersController.listenEvents(); // Do not do this in your testscustomersController.registerRoute(router); // Do not do this in your tests Methods registerRouteThe method to override to associate the controller with a route. Share HTML | BBCode | Direct Link