Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function defaultNav($title, $page) {
- $class = (strpos($_SERVER['REQUEST_URI'],$page) !== false) ? ' class="active"' : '';
- return '<li'.$class.'><a href="'.$page.'">'.$title.'</a></li>'.PHP_EOL;
- }
- function menuBuilder($menuList) {
- foreach ($menuList as $title => $page) {
- echo defaultNav($title,$page);
- }
- }
- $mainNav= array(
- 'Nav' => 'nav.php',
- 'Link One' => 'one.php',
- 'Link Two' => 'two.php',
- 'Link Three' => 'three.php',
- 'Link Four' => 'four.php',
- 'Link Four' => 'functions.php');
- menuBuilder($mainNav);
- menuBuilder($sidebarNav);
- $navItems = array(
- array(
- "slug" => "index.php",
- "title" => "Home"
- ),
- array(
- "slug" => "team.php",
- "title" => "Team"
- ),
- array(
- "slug" => "contact.php",
- "title" => "Contact"
- ),
- array(
- 'slug' => 'company.php',
- 'title' => 'The company'
- // Dropdown item One
- array(
- 'slug' => 'about-us.php',
- 'title' => 'About us'
- // Third dropwon
- array(
- 'slug' => 'john-doe.php',
- 'title' => 'John Doe'
- )
- array(
- 'slug' => 'timothy-mcgee.php',
- 'title' => 'Timothy McGee'
- // And so far, yeah i know, we need to write a nice looking css for this.
- array(
- 'slug' => 'timothy-mcgee.php',
- 'title' => 'Timothy McGee'
- )
- )
- )
- array(
- 'slug' => 'information.php',
- 'title' => 'Information'
- )
- )
- array(
- "slug" => "Contact.php",
- "title" => "Contact"
- )
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement