Replace underscore (_) with dashes (-) in URL |
[eluser]TheFuzzy0ne[/eluser]
My fault... The file should be called MY_Router.php, not Router.php. If we call it Router.php, CodeIgniter assumes you want to override the library, instead of extending it, so it doesn't load the base class.
[eluser]livewirerules[/eluser]
the function doesnt seem to be replacing the underscores. Other than placing that file in the core, do i have to load anything else separately?
[eluser]TheFuzzy0ne[/eluser]
No, you shouldn't need to load anything else. Try sticking a big, fat die() in the code somewhere, and see if it's really be loaded. Code: class MY_Router extends CI_Router If it's not working, maybe you've changed the prefix in your configuration file? By default, it should be: Code: $config['subclass_prefix'] = 'MY_';
[eluser]TheFuzzy0ne[/eluser]
I think we might be misunderstanding each-other here. Other than using a 301 header, the URL won't change. All this does, is change how the URL is perceived by CodeIgniter. For example, if you had the following controller: Code: class Foo_bar extends CI_Controller Normally, the URL to access it would be something like: http://example.com/foo_bar/bar_foo but with my modifications this should work, too: http://example.com/foo-bar/bar-foo |
Welcome Guest, Not a member yet? Register Sign In |