Welcome Guest, Not a member yet? Register   Sign In
How to extend the Default Controller
#1

[eluser]gregmax17[/eluser]
I have a question in regards to extending the default controller value/variable in the route configuration.

I would like to keep my URL clean as possible. When a user comes to the home page and look at all the front end/public pages, I want to have 1 controller called FrontEnd (or Public). So the home page of the site will have this in the URL:

http://www.example.com/

If I want to have a contact, support, and about pages, I would like to have the URL look like this:

http://www.example.com/contact OR
http://www.example.com/support OR
http://www.example.com/about

But as far as I can tell, it seems I have to create a controller for each one of these separate pages even though they should belong in the FrontEnd/Public controller.

Does this make sense? Is this possible with CI? I would like the default controller value in the route configuration to allows be called... and in my case... look in that default controller to see if that method exists, if not, assume its a controller. (and if that controller doesn't exist, its a 404 page)

I appreciate any help on this, thank you in advance.
#2

[eluser]Michael Wales[/eluser]
Look into URI Routing.
#3

[eluser]gregmax17[/eluser]
WOW!

Thank you for the quick reply and help. I got it working on my first effort, thanks again.




Theme © iAndrew 2016 - Forum software by © MyBB