CodeIgniter Forums

Full Version: Main navigation and sub navigation question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I searched the site and couldn't find a concise answer to this so,

I have a site with a main navigation:
Home About Projects Contact

And some pages have a sub navigation under the main one, for example the About page has:
Home About Projects Contact
FAQ History etc...

How would I make it so it would appear to be a "child" of the about page? So the URL would be

All the pages are being pulled out of a database and I am using one main controller with a view template where the main content is being pulled from the DB.


El Forum

If I understand the question correctly, the simplest solution seems to be to have a controller named 'about' and a function within it named 'faq'. That should get you the desired URL.

class About extends Controller {
    function About() {
    // URL: -OR-
    function index() { ... }
    // URL:
    function faq() { ... }

El Forum

[eluser]Sarfaraz Soomro[/eluser]
If the above is not what you want, may be you should take a look at URI Routing.
URI Routing