What are URI Routes in Gaseous?

Created by josh
July 28, 2020 6:55:15 PM PDT


In the Gaseous application, routes are simply a mapping of URI pattern to a controller script within the codebase. The installation of Gaseous is pre-populated with essential routes for core functionality, including login, registration, various administration panels, and for even more advanced things like asset rendering services (images, compressed CSS output and compressed JS output).

Routes are sorted in order, prioritizing which patterns should take precedent. For example, the very last route as installed by this system represents a "catch-all" pattern. After specific patterns in the list have a potential match, the last route will match when all else fails. This is important, because it is assumed that routes not specifically specified in the system are most likely URIs from pages generated by the CMS system. This is why this last-ditch catch-all pattern match is routed to the CMS' main controller (app/controllers/cms/index.php). Once the request is handed off to the CMS system, the CMS will determine if there are any published pages that match the URI provided - in which case, it will render the appropriate page or issue the browser a 404 error.