I have my menu styled with Bootstrap. My dropdown menu was like that with html+bootsrap:
<div class="container">
<div class="row">
<ul class="col-sm-3">
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
<ul class="col-sm-3">
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
<ul class="col-sm-3">
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
<ul class="col-sm-3">
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
</ul>
</div>
</div>
I used the class col-sm-3 every 4 items to achieve that.
But i cant do that in php cause i am using foreach loop and the result is like this one:
I tried with col-sm-3 but not..
<div class="collapse navbar-collapse btnCollapse">
<ul class="nav navbar-nav">
<li><a href="#">Home</a></li>
<?php foreach ($navItems as $item) { ?>
<li class="dropdown">
<a href="<?php echo $item['slug']; ?>" class="dropdown-toggle" data-toggle="dropdown"><?php echo $item['title']; ?><span class="caret"></span></a>
<?php if(isset($item['dropdown'])){ ?>
<ul class="dropdown-menu" role="menu">
<div class="container">
<div class="row">
<ul class="col-sm-3">
<?php foreach($item['dropdown'] as $subitem) { ?>
<li><a href="<?php echo $subitem['slug'] ?>"><?php echo $subitem['title'] ?></a></li>
<?php }; ?>
</ul>
</div>
</div>
</ul>
<?php }; ?>
</li>
<?php }; ?>
</ul>
</div>
WHats the way to achieve that?
Maybe should I use For loop instead of foreach? I dont know..
Any feedback?
