uplift — 2012-08-10T09:07:33-04:00 — #1
I'm trying to implement URL routing into my web app but struggling, i've followed the mvc structure so urls are /controller/class
i want to be able to change '/profile/edit_profile' to '/edit-profile'.
I've done something similar in CodeIgniter in routes.php i would add
$route['edit-profile'] = 'profile/edit_profile';
but can't think of the logical way to code this
tomb — 2012-08-10T09:58:02-04:00 — #2
There are essentially two ways of doing it:
-A routing table, mapping each possible route to a controller/controller acton.
-Convention over configuration: Taking a best guess approach and having a standardised URL format for routing. e.g. /controller-action/foo/bar maps to $controller->action('foo', 'bar');
I wrote about this in some detail here: http://r.je/mvc-php-front-controller.html
uplift — 2012-08-10T10:20:23-04:00 — #3