I have a website which is built on Codeigniter and I want to create some pages with information like terms or privacy, their address should be:
http://domain.com/terms
http://domain.com/privacy
My question is: should I create for each page a controller? In CMS for example, if I add a page it has to create a ‘pysical’ page on the server (CMS which is built on Codeigniter)?
For static pages like a Privacy Policy or Terms of Service page where they don’t really fit under any other controller I usually create a “content” controller that looks something like this:
Then I add some routes to remove “content” from the URL:
That way you don’t need to create a new controller for each page and you can keep your static pages organized in a single spot.