• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Routing and Remap

#8
[eluser]darkhouse[/eluser]
I actually posted about this last year, here [url="http://ellislab.com/forums/viewthread/107451/#541043"]http://ellislab.com/forums/viewthread/107451/#541043[/url] and I'm still using this code today.

I just don't think the CMS should take every request, I think it should be the last resort. This system allows you to have custom pages (or just have content management for a couple of your pages) and you don't have to create a route for each one. It checks to see if the file exists first, and if not then hand it over to the CMS to deal with. The CMS from there will take the URI, see if there's a corresponding page in the database, and load it up if there is. If it doesn't exist, it shows a 404 like it would normally.

It has come in quite handy for a couple of things, but the main thing was the CMS that still allowed custom pages. I'm using it right now for a hotel site, they wanted to control most of their content, but then also have an online booking system that works with their internal software. Sure I could've made a route for just one controller (actually it would've been a number of routes as it has subpages), but as I said before I think the CMS should come last, not first, and this way I don't have to worry about creating routes for items I shouldn't need to create routes for in the first place.


Messages In This Thread
Routing and Remap - by El Forum - 02-07-2010, 02:34 AM
Routing and Remap - by El Forum - 02-07-2010, 04:20 PM
Routing and Remap - by El Forum - 02-07-2010, 04:47 PM
Routing and Remap - by El Forum - 02-07-2010, 04:50 PM
Routing and Remap - by El Forum - 02-07-2010, 04:54 PM
Routing and Remap - by El Forum - 02-07-2010, 04:56 PM
Routing and Remap - by El Forum - 02-07-2010, 05:05 PM
Routing and Remap - by El Forum - 02-07-2010, 05:29 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.