0
내가 foreach 문을 사용하여 복제하기 위해 노력하고있어 코드의 블록을 가지고,하지만 난 수행하는 방법에 주변에 얻을 수있는이 코드는 다음과 같다 :문제
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">Content</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
<table class="table">
<tr>
<td>
<span class="glyphicon glyphicon-pencil text-primary"></span><a href="">Articles</a>
</td>
</tr>
<tr>
<td>
<span class="glyphicon glyphicon-flash text-success"></span><a href="#">News</a>
</td>
</tr>
<tr>
<td>
<span class="glyphicon glyphicon-file text-info"></span><a href="#">Newsletters</a>
</td>
</tr>
<tr>
<td>
<span class="glyphicon glyphicon-comment text-success"></span><a href="#">Comments</a>
<span class="badge">42</span>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="panel panel-default">
{foreach $produtosGC1 as $produto}
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">{[email protected]}</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
<table class="table">
{foreach $produto as $item}
<tr>
<td>
<a href="">{$item}</a>
</td>
</tr>
{/foreach}
</table>
</div>
</div>
{/foreach}
</ul>
</div>
:
이 거의 다 내 시도이며, 이는 접을 수있는 사이드 바의 일부이며, 이상적으로 EG와 AG 자신
This is the array I'm trying to display on this block
$smarty -> assign('produtosGC1',
array('EG' => array('Tipo ST','Tipo LP','Tipo SG','Hollowbody'),
'AG' => array('Clássicas','Aço')
));
에 섹션이 0 것은 두 번째 타이틀합니다 (AG)이 하위 범주 제대로 연결하지 않고 제대로
편집을 축소하지 않습니다이다
: 그것은
"거의 다 왔어"다행입니다. 뭐가 문제 야? 질문이 뭐야? – Chris
약간의 수정을했는데, 지금은 더 설명이 잘되어 있다고 생각합니다. –
결코 멋지게 사용한 적이 없으며 접을 수있는 메뉴가 어떻게 작동하는지 정확하게 알지 못합니다. 그러나 나는 당신의 수업이 중복되고 있음을 주목합니다. 당신은 그들이 모두'붕괴 원 '이 될 것이라는 확신을 갖고 있습니까? 고유해야 할 경우 일종의 카운터가 있어야하며 div 클래스와 데이터 토글 href의 값을 모두 늘려야합니다. –