Trongate Docs
switch to dark modeswitch to dark mode
»
»
How Basic URL Routing Works

How Basic URL Routing Works

Imagine you've been hired to build a database driven web app for a chess club.  Let's assume that the URL for invoking (displaying) a particular member's profile page takes the following form:

example.com/members/profile/88

With Trongate's basic URL routing, the URL above would:

  • load the 'members' module
  • load the 'members' class from within the module
  • invoke the 'profile' method
  • pass the number 88 into the method, as an argument
  • The Rules (for basic routing)

    As you can see, Trongate follows a simple set of rules for mapping a URL to a particular module and method.  The rules for basic URL routing are:

  • assume the first URL segment to be the name of the module and class to be loaded
  • assume the second URL segment to be the name of the method that is to be invoked
  • assume the third segment (if there is one) to be the value that is to be passed into the method
  •  


    HELP & SUPPORT

    If you have a question or a comment relating to anything you've see here, please goto the Help Bar.

     
    ×