我=0。我想在 foreach 中创建 tab1、tab2、tab3 等,如果 i=1 则首先 echo class="active" < li >。怎么做?
{elseif $complexField == "KeySkills"}
<ul>
{foreach from=$complexElements key="complexElementKey" item="complexElementItem"}
{foreach from=$form_fields item=form_field}
{if $form_field.caption == "Key personal skill"}
<li
(如果 i=1 则 echo class="active")
><a href="#
选项卡1
" data-toggle="tab">{display property=$form_field.id complexParent=$complexField complexStep=$complexElementKey} </a></li>
{/if}
{/foreach}
{/foreach}
</ul>
<div class="tab-content" style="min-height:470px;">
{foreach from=$complexElements key="complexElementKey" item="complexElementItem"}
{if $form_field.caption == "Percentaged Key Skill" || $form_field.caption == "Skill Detail"}
<div class="tab-pane fade active in" id="
选项卡1">
<div class="item_top">
<p> {display property=$form_fields.SkillDetail.id complexParent=$complexField complexStep=$complexElementKey} </p>
<div class="donutchart2" data-percent="{display property=$form_fields.PercentKeySkill.id complexParent=$complexField complexStep=$complexElementKey}"></div>
</div>
</div>
{/if}
{/foreach}
</div>