Skip to content

DrF Reverse Routing

World Wide Web Server edited this page Jul 4, 2012 · 29 revisions

DrF Reverse Routing is an extension of the URL Helper that overrides the site_url function to provide a reverse lookup. If a custom route can be found that matches the given "standard CodeIgniter URI", a custom route URI will be created and returned. Otherwise, a standard site_url will be returned.

[h2]Overview[/h2]

  • Translates a "standard CodeIgniter URI" into a custom route if possible
  • Fails gracefully, providing a standard site_url if no route can be found/translated
  • Works automatically with all of URL Helper's functions
  • Idea inspired by CakePHP's reverse routing

[h2]Download[/h2] File:DrF_Reverse_Routing.zip

[h2]Usage[/h2]

  • place MY_url_helper.php in your system/application/helpers folder
  • include the URL helper as you normally would [code]$this->load->helper( 'url' );[/code]

[h2]Example[/h2]

  • setup a Test Controller [code]

[/code]

Clone this wiki locally