Search code examples
phpmodel-view-controllercodeigniteractiondynamic-function

dynamic action names in codeigniter or any php mvc framework


I've noticed many sites are able to use a username or page title as an action. How is this done?

For example instead of www.example.com/users/my_username (where the users action is generic and responsible for fetching user data) how could I make this www.example.com/my_username?

Thanks very much.


Solution

  • All modern frameworks follow router ideology. So for this task you just need to write yet another route.

    How to do this - is a specific task for particular framework.