Automatic Routing

Automatic Routing

ryanthompson -
6 months ago

Something that is SUPER wasteful with resources and just not necessary.. the majority of our routing.

The idea here is to automate CRUD and define a best case for control panel routing. Here is my proposal:

admin/* // Engages automatic routing
admin/{slug} // Defines the module to use which will use same name stream for controller by default (pages/pages), otherwise first stream defined if none match the namespace/slug
admin/{slug}/{stream} // Defines the stream to access CRUD for based on the slug / namespace and the index method.
admin/{slug}/{stream}/{action} // Defines all as well as the controller action

Anything past this it will look into subdirectories, then a controller, then index method OR method if provided.

Let's open this up for discussion and point out any best cases you know of and pick it apart!