Replace underscore (_) with dashes (-) in URL |
[eluser]Aken[/eluser]
[quote author="TheFuzzy0ne" date="1364669682"]You're going to run into trouble if you do this, because you can't use hyphens in class/method names.[/quote] That's exactly what he's trying to do -- automatically turn hyphens in his URL into underscores, so that they will map to controllers/methods without needing routes. CI 3.0 added this feature. I suggest either: A) Update your application to CI 3.0. You can find the in-progress dev version here. B) Extend the Router class and replace the _validate_request() method from here. Note that there may be other changes in this method that I forgot about that may affect your app. I don't remember everything off hand, but that's where the str_replace stuff happens. So might get you in the right direction for now. |
Messages In This Thread |
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-30-2013, 08:26 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-30-2013, 10:26 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-30-2013, 11:54 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-30-2013, 04:41 PM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 06:04 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 06:07 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 06:17 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 06:45 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 07:31 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 08:53 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 08:56 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 10:31 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 10:36 AM
Replace underscore (_) with dashes (-) in URL - by El Forum - 03-31-2013, 10:42 AM
|