Пример #1
0
 static function display_children($parent, $level)
 {
     $clases = [1 => 'dropdown-toggle', 2 => 'dropdown-menu', 3 => 'dropdown-toggle'];
     $data = Menu::menu($parent);
     echo "<ul class='nav navbar-nav'>";
     foreach ($data as $que) {
         if ($que->Count > 0) {
             echo "<li class='dropdown'>\n                <a class='" . $clases[$level] . "'href='" . $que->url . "'>" . $level . " " . $que->nombre . "</a> <span class='caret'></span></a>";
             Menu::display_children($que->id, $level + 1);
             echo "</li>";
         } elseif ($que->Count == 0) {
             echo "<li><a href='" . $que->url . "'>" . $que->nombre . "</a></li>";
         } else {
         }
     }
     echo "</ul>";
 }