Hey guys
First of it is my first time working with a Framework and a Template System.
I want to create a menu but right now i don't know how i could do it.
In the Template i want it to look like this
<div id='menu">
<div class="menuHead"> {{ $menuHead }}</div>
<div class="menuCount"> {{ $menuCont }} </div>
</div>
Right now i call it like this MenuHandler::Buildmenu('1') (1 is the left side and 2 the rightside of the homepage menubar)
so now i want to have it loop all inside the menu div do that it looks like this
Menu
-> Links
-> Downloads
Menu2
-> News
-> Forum
but i dont know how i could do this
right now my code looks like this
public static function BuildMenu($menu) {
$men = "<div id='menuWrapper'>";
$x = null;
foreach($menu as $k):
if($k->cname !== $x) {
$men .= '<div class="menuHead">'.$k->cname.'</div>';
$x = $k->cname;
}
if($k->was != "box") {
if($k->name != ""):
$men .= "<div class='menuCont'><a href='/".$k->url."'><li>".$k->name."</li></a></div>";
endif;
} else {
$men .= view('sections.boxes.'.$k->name);
}
endforeach;
$men .= "<div>";
return $men;
}
This works but is not how i would like it to be maybe u can help me