[1092] 前端技術入門
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<{foreach from=$slider_var key=k item=slide name=slider_var}>
<!-- 從0開始的次數 <{$smarty.foreach.slider_var.index}> -->
<!-- 從1開始的次數 <{$smarty.foreach.slider_var.iteration}> -->
<div class="carousel-item <{if $smarty.foreach.slider_var.index == 0}>active<{/if}>">
<img src="<{$slide.file_url}>" class="d-block w-100" alt="<{$slide.file_name}>">
</div>
<{/foreach}>
</div>
<{if $show_slide_control=='1'}>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
<{/if}>
</div>