Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

pagination liste de url

 
Post new topic   Reply to topic    Smarty Forum Index -> Language: French
View previous topic :: View next topic  
Author Message
tdan
Smarty Rookie


Joined: 27 Mar 2015
Posts: 8

PostPosted: Wed Apr 22, 2015 10:14 am    Post subject: pagination liste de url Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Language: French All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP