This is kind of an academic question, so feel free to exit now. I've had a dig through Stack for threads pertaining to URL/Controller mapping in MVC frameworks - in particular this one:
PHP Application URL Routing
So far, I can ascertain two practices:
1: dynamic mapping through parsing the URL string (exploded on '/')
2: pattern matching matching url to config file containing available routes
I wanted to get some feedback (or links to some other threads/articles) from folks regarding their views on how best to approach this task.
You can mix both options. Most frameworks do it to manage URL mapping. The first one is the default and the second one is the alternative. One php framework that uses it is Zend. you may check out zend_router for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With