Using nested for loop in twig -


how write following php code snippet in twig :

<?php foreach ($categories $category) { ?>     <li class="level0 nav-6 level-top first parent"><a class="level-top" href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>         <?php if ($category['children']) { ?>             <ul class="level0">             <?php ($i = 0; $i < count($category['children']);) { ?>                 <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>                 <?php (; $i < $j; $i++) { ?>                     <?php if (isset($category['children'][$i])) { ?>                         <li class="level1 nav-6-1 first"><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>                     <?php } ?>                 <?php } ?>             <?php } ? 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -