• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Main navigation and sub navigation question

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 www.mysite.com/index.php/about/faq

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.


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: http://www.somedomain.com/index.php/about -OR- http://www.somedomain.com/index.php/about/index
    function index() { ... }
    // URL: http://www.somedomain.com/index.php/about/faq
    function faq() { ... }

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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.