PHP
- 1 ответ
- 0 вопросов
1
Вклад в тег
<?php if ($categories) { ?>
<div class="container">
<a class="toggleMenu" href="#">Menu</a>
<ul class="nav_menu">
<?php foreach ($categories as $category) { ?>
<li>
<a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php if ($category['children']) { ?>
<?php for ($i = 0; $i < count($category['children']); $i++) { ?>
<ul>
<?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
<?php for (; $i < $j; $i++) { ?>
<?php if (isset($category['children'][$i])) { ?>
<li>
<a href="<?php echo $category['children'][$i]['href']; ?>">
<?php echo $category['children'][$i]['name']; ?></a>
</li>
<?php } ?>
<?php } //for i < $j ?>
<?php } //for ($i = 0; $i < count ?>
</ul>
<?php } // if ($category['children']) #8 ?>
</li>
<?php } // foreach ($categories as $category) ?>
</ul>
<div>
<?php } ?>