我试图在星级评定的动态表单上循环。问题是这只适用于第一次迭代。这是我的代码:(聪明的)。
<form action="">
forEach{ $lstCodesNotation as $oneCodeNotation}
<p>{$oneCodeNotation.description}</p>
<input class="star star-5" id="star-5" type="radio" name="star"/>
<label class="star star-5" for="star-5"></label>
<input class="star star-4" id="star-4" type="radio" name="star"/>
<label class="star star-4" for="star-4"></label>
<input class="star star-3" id="star-3" type="radio" name="star"/>
<label class="star star-3" for="star-3"></label>
<input class="star star-2" id="star-2" type="radio" name="star"/>
<label class="star star-2" for="star-2"></label>
<input class="star star-1" id="star-1" type="radio" name="star"/>
<label class="star star-1" for="star-1"></label>
{/foreach}
</form>
你的foreach写得不正确,你必须像这样把它放到{
:
{foreach $lstCodesNotation as $oneCodeNotation}