Welcome Guest, Not a member yet? Register   Sign In
explicit controllers vs. class functions

[eluser]charlie spider[/eluser]
I'm working on a site with a CMS backend and it is my second CI project.

One of the things i would like to do with this is develop the ability to dynamically generate new pages. I'm currently storing all of the user editable content in a db and populating a couple of different view pages that act as templates. With the first site i developed in CI, i used a separate controller for every page of the site (small site - 8 pages).

I would like the url's for the new site to look like this:



i would like to be able to add a new page to the db and have the name of the page (shortened url-friendly version) to appear as if it were a controller class. In other words, be able to retrieve the controller class name from the db. Or at least make it look that way.

is there anyway to do this within the CI framework or am i looking at an .htaccess job ?

i have no problem adding dynamic pages that are created by a function but then the url's look like this:


which is fine when the new page is appropriate for the structural hierarchy of the site. ie:


So i would like to know if controller classes ALWAYS have to be explicitly called or can they be faked using a function ?

i haven't had the time to delve far enough into CI to know if this is possbile to do using custom routes or hooks (don't know what either of those are even) but if someone could point me in the right direction i would be eternally gratefull.

Thanks in advance for any help

Messages In This Thread
explicit controllers vs. class functions - by El Forum - 01-22-2008, 12:24 AM
explicit controllers vs. class functions - by El Forum - 01-22-2008, 01:12 AM
explicit controllers vs. class functions - by El Forum - 01-22-2008, 02:17 AM

Theme © iAndrew 2016 - Forum software by © MyBB