Browsing articles tagged with " mvc"
Nov
9
2011

Parse MVC style urls in PHP

If you have used codeigniter or some mvc php framework then you might be aware of urls like www.yoursite.com/index.php/class/method/param1/param2?a=b&c=d or www.yoursite.com/class/method/param1/param2?a=b&c=d if you use mod rewrite to add the index.php The htaccess code could be like this : The above kind of urls need to be parsed inside PHP to extract the class name , method name and parameters. The parsing approach could be different based on the Server API (sapi) PHP is using. 1. [...]