I’m using collections to generate a menu of categories.
The idea is to have this structure:
<nav class="collapse show navbar navbar-vertical navbar-light align-items-start p-0 border border-top-0 border-bottom-0" id="navbar-vertical">
<div class="navbar-nav w-100 overflow-hidden" style="height: 350px">
<a href="" class="nav-item nav-link">Menu A</a>
<a href="" class="nav-item nav-link">Menu B</a>
<a href="" class="nav-item nav-link">Menu C</a>
</div>
</nav>
Using collections, I managed to bring the categories in this way:
<nav class="collapse show navbar navbar-vertical navbar-light align-items-start p-0 border border-top-0 border-bottom-0" id="navbar-vertical">
<div class="navbar-nav w-100 overflow-hidden" style="height: 350px">
<?php echo $this->Html->link(collection($json["data"])->combine('id', 'name')->toArray(), '/pages/link', array('class' => 'nav-item nav-link ')); ?>
</div>
</nav>
The problem is that the menus are not one under the other.
Could you help me with this structure?