I'm having a little problem at figuring this out:
Code:
function myMenu() //Creates a menu with a class current to the current page item
{
$menuItems = array (
"Strona Głowna" => "index.php",
"O nas" => "o-nas.php",
"Oferta" => "oferta.php",
"Polecane kierunki" => "polecane-kierunki.php",
"kontakt" => "kontakt.php",
);
foreach($menuItems as $name => $url) {
$class = 'default';
$index = 'index.php';
if ((curPageName() == $url) && (curPageName() !== $index)) {
$class='current';
}
echo "<li><a href='$url' class='$class'>$name</a></li>";
elseif (curPageName() == $index) {
$class='current home';
}
echo "<li><a href='$url' class='$class'>$name</a></li>";
};
};
Basically I want to assign the 'current home' to the index.php ONLY. Maybe you can come with better solutions, I'm a newbie at this. Anyway, this gives me: PHP Parse error: syntax error, unexpected T_ELSEIF in ...
Any help sorting this out appreciated!