foreach ($nav_items as $nav_href=>$nav_title=>$nav_class) {
if ($pageHref == $nav_href) {
echo '<li class="' . $nav_class . 'active">' . $nav_title . '</li>';
} else {
echo '<li class="' . $nav_class . '">' . $nav_title . '</li>';
}
}
What is wrong with this code above? This corresponds to the array below.
$pageLoc = 'where';
$nav_items = array(
'index'=>'Home'==>'',
'where'=>'Where?'==>'dropdown'==>'',
'appeals'=>'Current Appeals'==>'',
'news'=>'Latest News'==>'',
'events'=>'Events'==>'',
'dontate'=>'Dontate'==>'',
);
I am basically trying to put an active class in front of the list item when it matches $pageLoc and when it doesn't just a simple <li class=""> BUT the dropdown menu item: 'where?' needs a <li class="dropdown"> always! and when it is active, it will be <li class="dropdown active">