I\'m looking for a one line route to route dashed controller and method names to the actual underscored controller and method names.
For example the URL
Put this file MY_Router.php inside /application/libraries (CI1) or /application/core (CI2) Remember that this will effect all segments, not only module, controller and method.
Alternative to this extend is to add each segment to router.php $route['this-is-a-module-or-controler'] = 'this_is_a_module_or_controller';
As you can see the extend method would be easier to use. You can choose to make the function also to handle only the first two or three segments so that the other segments are not affected with the _ replacement.