[eluser]systemsos[/eluser]
Howdy everyone,
Just after a little bit of help with CI's routes. I have the following setup.
I have a main controller, which handles dynamic menus and their content. So in my example I'm re-doing my website (it desperately needs my love and attention and not a 2 minute hack).
I have the following things redirect to the default controller - which determines what section we're looking at, and what page of that section we're looking at.
I have;
/domains
/domains/some-pages
/hosting
/hosting/some-pages
/another-thing
/another-thing/and-it's-pages
Now I've been using routes for ['domains'] and pushing it back to my default controller, but that requires me to edit the routes.php file itself any time a new section is added.
As far as CMS goes - I don't like that idea.
I could use no route - and create a proper handling controller so that my site was
mysite.com/site/domains - but I want to remove the /site/ all together.
So now I've added a [':any'] and [':any/:any'] clause in my routes config. Which pushes "everything" back to the default controller. But I want "blog" for example to not be pushed there.
So I add a ['blog'] = "blog"; to goto that controller instead. But then if I goto /blog/something it doesn't work.
If I add ['blog/:any'] = "blog" - it just pushes it back to the default controller (and the index function) rather than where I would want it to go (it's normal function).
This isn't a problem at the moment, but I just thought I would see if anyone else has done something similar to what I'm trying to do.
Cheers for your thoughts
[i]Edit: I have been trying to do something like $route['blog/:any'] = "blog/$2" but I don't actually know the proper setup for this.