registerRoute Summary Registers a route. Signatures Click on a signature to select it and view its documentation. public override void registerRoute(string hash, void() show, void() hide) public override void registerRoute(string hash, void(...string arguments) show, void() hide) public override void registerRoute(string hash, void() show, void(...string arguments) hide) public override void registerRoute(string hash, void(...string arguments) show, void(...string arguments) hide) Usage public override void registerRoute(string hash, void() show, void() hide) public override void registerRoute(string hash, void(...string arguments) show, void() hide) public override void registerRoute(string hash, void() show, void(...string arguments) hide) public override void registerRoute(string hash, void(...string arguments) show, void(...string arguments) hide) Parameters hash The hash (sans the # symbol) to associate the route with. show The method to call when the route should be shown. hide The method to call when the route should be hidden. Parameters hash The hash (sans the # symbol) to associate the route with. show The method to call when the route should be shown. The arguments passed to this method are the arguments for the route parameter(s). hide The method to call when the route should be hidden. Parameters hash The hash (sans the # symbol) to associate the route with. show The method to call when the route should be shown. hide The method to call when the route should be hidden. The arguments passed to this method are the arguments for the route parameter(s). Parameters hash The hash (sans the # symbol) to associate the route with. show The method to call when the route should be shown. The arguments passed to this method are the arguments for the route parameter(s). hide The method to call when the route should be hidden. The arguments passed to this method are the arguments for the route parameter(s). Description Registers a route with the associated hash (do not include the # symbol). Once a route becomes "active", the show method will be called. In addition, all inactive routes will have their hide method called. Route parameters are available with the following syntax: user/:id route/:param1/:param2 Registers a route with the associated hash (do not include the # symbol). Once a route becomes "active", the show method will be called. In addition, all inactive routes will have their hide method called. Route parameters are available with the following syntax: user/:id route/:param1/:param2 Registers a route with the associated hash (do not include the # symbol). Once a route becomes "active", the show method will be called. In addition, all inactive routes will have their hide method called. Route parameters are available with the following syntax: user/:id route/:param1/:param2 Registers a route with the associated hash (do not include the # symbol). Once a route becomes "active", the show method will be called. In addition, all inactive routes will have their hide method called. Route parameters are available with the following syntax: user/:id route/:param1/:param2 Examples Basic Usage 12345678910111213141516171819import Altitude.Frontend;import Altitude.Frontend.RouteEngines; external $; class CustomersView{ public void show() { $(".customers").show(); } public void hide() { $(".customers").hide(); }} class CustomersController : RoutedController{ CustomersView view = new CustomersView(); public override void registerRoute(IRouter router) { router.registerRoute("customers", this.view.show, this.view.hide); }} Basic Usage 123456789101112131415161718192021222324252627import Altitude.Frontend;import Altitude.Frontend.RouteEngines; external $; class CustomersView{ public void show(...string arguments) { unsigned int customerID = UInteger32.fromString(arguments[0]); $(".customers").show(); $(".customer-" + customerID.toString()).show(); } public void hide() { $(".customers").hide(); }} class CustomersController : RoutedController{ CustomersView view = new CustomersView(); public override void registerRoute(IRouter router) { router.registerRoute("customers/:id", this.view.show, this.view.hide); }} Basic Usage 123456789101112131415161718192021222324252627import Altitude.Frontend;import Altitude.Frontend.RouteEngines; external $; class CustomersView{ public void show() { $(".customers").show(); } public void hide(...string arguments) { unsigned int customerID = UInteger32.fromString(arguments[0]); $(".customers").hide(); $(".customer-" + customerID.toString()).hide(); }} class CustomersController : RoutedController{ CustomersView view = new CustomersView(); public override void registerRoute(IRouter router) { router.registerRoute("customers/:id", this.view.show, this.view.hide); }} Basic Usage 123456789101112131415161718192021222324252627282930import Altitude.Frontend;import Altitude.Frontend.RouteEngines; external $; class CustomersView{ public void show(...string arguments) { unsigned int customerID = UInteger32.fromString(arguments[0]); $(".customers").show(); $(".customer-" + customerID.toString()).show(); } public void hide(...string arguments) { unsigned int customerID = UInteger32.fromString(arguments[0]); $(".customers").hide(); $(".customer-" + customerID.toString()).hide(); }} class CustomersController : RoutedController{ CustomersView view = new CustomersView(); public override void registerRoute(IRouter router) { router.registerRoute("customers/:id", this.view.show, this.view.hide); }} Share HTML | BBCode | Direct Link