10 月 12
Smartyのsection関数のiterationを使うことでループの現在の値を得られるので、それを活用しよう。
実際に見た方が圧倒的に早いだろう。
{section name=pager loop=$allpagenum}
{if $curpage == $smarty.section.pager.iteration}
<strong>{$smarty.section.pager.iteration}</strong>
{else}
<a href="リンク先&page={$smarty.section.pager.iteration}">{$smarty.section.pager.iteration}</a>
{/if}
{/section}
$allpagenumにはページ数をsetしておく。
$curpageには現在のページをsetしておく。
まぁこういうこと。





Recent Comments