Smarty foreach döngü son endeks değeri almak nasıl, smarty için ben bu kodu kullanmış ama onun değil çalışma im yeni
{foreach from=$cityList key=myId item=i name=foo}
{$i.location_name}{if $main_smarty.foreach.foo.last}<hr>{else}-{/if}
{/foreach}
Ben istiyorum ki son şehir ismi bu yatay çizgi gelip aksi takdirde onun gibi india-ABD-Japonya-ama sonunda gelip Japonya-çin sonra onların olduğu
I kullanın. Php
<?php
include_once('Smarty.class.php');
$main_smarty = new Smarty;
query to find citylist
$main_smarty->assign('cityList',$cityList);
?>