![]() |
DrF Reverse Routing - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: DrF Reverse Routing (/showthread.php?tid=8574) |
DrF Reverse Routing - El Forum - 03-31-2009 [eluser]drfloob[/eluser] [quote author="Johan André" date="1237914544"] Is this an known error? [/quote] Nope. Good catch! I wrote a quick patch & uploaded a new version to the Wiki (with diff and changelog included). I tested it to make sure it works for your case and the cases listed in the wiki page, but you should probably make sure it doesn't break anything else for you ;-). I'm really glad you're getting some use out of my code, and thanks for the recommendation to have it merged into the core. For what it's worth, I wrote DrFRR just to scratch an itch. I'd suggest, before anyone considers merging anything into CI, that this helper have a few unit tests and maybe some profiling / optimization done. It could probably use both. DrF Reverse Routing - El Forum - 04-03-2009 [eluser]Phil Sturgeon[/eluser] I did this a while back, but nobody seemed very interested! http://ellislab.com/forums/viewthread/102438 DrF Reverse Routing - El Forum - 04-03-2009 [eluser]drfloob[/eluser] @phil: Your code looks nice, very clean and simple. DrF Reverse Routing handles regex fine, so if you're not interested in using it, you can at least use the code as a reference to see how it was done. @all: If anyone is actually considering integrating DrFRR into CI, can we please have some sort of poll/vote to pick a new name? "DrF Reverse Routing" is absolutely hideous. I shouldn't be allowed to name things ![]() DrF Reverse Routing - El Forum - 04-14-2009 [eluser]Phil Sturgeon[/eluser] As I got to the stage of handling regex as anything between brackets, I decided to drop this as it would have obvious performance issues on a large site, and until I hook mine up to a DB it will be horrendous. What sort of regex rules can this handle in routes? DrF Reverse Routing - El Forum - 04-16-2009 [eluser]drfloob[/eluser] It'll handle any captured regex, iirc. In the case of uncaptured regex, it falls back to standard routes. The code works by replacing references in the replacement string with the associated captured regex pattern. Any valid captured regex patterns should be translated correctly. DrF Reverse Routing - El Forum - 11-25-2009 [eluser]Unknown[/eluser] Nice extension ![]() But i have one Problem.. my URL looks like this: Code: example.com/main/agb Code: example.com/agb ![]() Code: example.com/foo/bar is this possible? DrF Reverse Routing - El Forum - 11-25-2009 [eluser]BrianDHall[/eluser] I've been looking for just this functionality, and was going to implement something myself - but didn't even think to use routes in a reverse fashion. Very nice! I'm saving this and going to try it out. I too love the SEO features of routing, yet was really annoyed by having to hardcode links. Another advantage is code readability and brevity. This way you can name your controllers and functions in ways that make sense to a programmer, then rename them to things that make sense from an SEO Strategy point of view without changing around code. DrF Reverse Routing - El Forum - 11-26-2009 [eluser]jcavard[/eluser] [quote author="drfloob" date="1238813085"]@all: If anyone is actually considering integrating DrFRR into CI, can we please have some sort of poll/vote to pick a new name? "DrF Reverse Routing" is absolutely hideous. I shouldn't be allowed to name things ![]() I grant you permission to use this name: "JCAvard's absolutely amazing reverse routing library." DrF Reverse Routing - El Forum - 09-01-2010 [eluser]mattalexx[/eluser] @drfloob To more exactly recreate the allowed input of the core site_url(), change this: Code: function site_url($uri = '') Code: function site_url($uri = '') Code: site_url(array('artists', 'view', 123)) But I like to do this: Code: site_url('artists', 'view', 123) Code: function site_url($uri = '') DrF Reverse Routing - El Forum - 09-01-2010 [eluser]WanWizard[/eluser] Note that load_class() behaviour is changed in CI 2.0, so when you upgrade this is no longer going to work. For 2.0, use Code: $Router =& load_class('Router', 'core'); |