|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
tdan Smarty Rookie
Joined: 27 Mar 2015 Posts: 8
|
Posted: Wed Apr 22, 2015 10:14 am Post subject: pagination liste de url |
|
|
Comment puis-je intégrer une pagination dans un "loop" dans mon bout de code?
Pour obtenir: [1] [2] [3] [4]
Code: |
<?php
function liste($l){
if ($handle = opendir($l)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
$la[] = $entry;
}
}
closedir($handle);
}
return $la;
}
$i = liste('./web/img/img');
$smarty->assign('i', $i);
?>
|
C'est ma loop dans mon template smarty:
Code: |
{foreach name=liste_imgs from=$i item=ll}
<a rel="album" href="./web/img/img/{$ll}"><img src="./web/img/tns/{$ll}"></a>
{/foreach}
|
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|