1) It is better to implement something like:
<?php $route = new Routing(); $route->foo('/example', array( 'MainController' => 'example' ) ); ?>
The first argument is an alias, obtained from the url, the second array, where it is indicated where to apply if the link coincided with the alias.
2) Or stored in the database, the field "link" and "alias", and with each page request, make a selection and show the link that matched.
3) Here's another option, Habré . There through xml. Can I use ini files?
Here I did not consider the option where the URL is broken into parts, and then, depending on the link, the controller, method, action is directly called ...
So, comrades, I ask you, as more experienced, which approach is better? If the options given by me are unsuccessful, please provide a more convenient and safer alternative :)