Ok, here's the deal. The URL in our framework is vital to determining:
The module being loaded
The action being executed
Everything else is just appended to the URL. The unfriendly version looks something like:
index.php?___module___=behaviour&___action___=enterSlip&some=other&args
It wouldn't suffice to change that to:
/___module___/behaviour/___action___/enterSlip/some/other/args
In fact, I'd like to be able to entirely mask the names of the modules and actions and simply handle that internally, so we could maybe access the above page on:
/incidents/new/some/other/args
Tying it down to just the module/action names isn't good enough neither. To all intent and purpose those are just like any of the other arguments so I'd even like to be able to map things like:
index.php?___module___=behaviour&___action___=update&state=1
index.php?___module___=behaviour&___action___=update&state=0
To
/behaviour/update/enable
/behaviour/update/disable
It's all just regex work basically. The URLs in our app are handled by functions so it's easy for us to change the format of them by modifying these functions.
One thing I would like to see support for out of interest is this:
index.php?foo[]=something&foo[]=somethingElse&bar=1
Here $_GET['foo'] is an array with two elements. I wonder how that can be represented in a friendly URL? Maybe
/foo/something,somethingElse/bar/1
In terms of interface I'm thinkining along the lines of:
Code: Select all
$router->addRoute("some%pattern%here", "actual url here");
We could pull those from a config file.
Anyone got anything to add in terms of possible schemas which I might need to address?
