Welcome Guest, Not a member yet? Register   Sign In
Dynamic Routes
#1

[eluser]Adam Griffiths[/eluser]
This has been discussed to death on the forums but none of the topics I read through answered my question, so here goes.

Quick question on last line.

I am developing a CMS in CI and need to make use of dynamic routes. At first I thought it was easy as using the DB class, but obviously I can't use it in a config file.

Then I had the idea of using a hook, but then I have no experience with hooks, and since I'd have to use an early system hook, no of the classes would have been loaded by then.

The next idea was to search the forums, that didn't really help me either.

So, how would I go about creating a hook to get dynamic routes? Is a hook the best way to do it?

I don't think I explained it well enough...I have a database table called routes, inside there I have fake_route and real_route, fake_route is the URI the user will see, and real_route is the route we map it to.

I need to loop through a db query to grab all of the routes and process them however.

For example I could have /home that will map to pages/index/home, whereas /blog will map to blog/ or similar.

Any ideas on my dilemma?

Basically, what's the best way to implement dynamic routes taken from a DB?

All comments appreciated!


Messages In This Thread
Dynamic Routes - by El Forum - 09-24-2008, 03:34 PM
Dynamic Routes - by El Forum - 09-24-2008, 04:04 PM
Dynamic Routes - by El Forum - 09-24-2008, 04:17 PM
Dynamic Routes - by El Forum - 09-24-2008, 04:34 PM
Dynamic Routes - by El Forum - 09-24-2008, 05:36 PM
Dynamic Routes - by El Forum - 09-25-2008, 03:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB