Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URL Controller Mapping Strategies (PHP)

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.

like image 703
sunwukung Avatar asked Apr 11 '10 21:04

sunwukung


1 Answers

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.

  • http://www.framework.zend.com/manual/1.7/en/zend.controller.router.html
like image 109
Hanseh Avatar answered Sep 22 '22 20:09

Hanseh