Pagination dans une action

class PhotosController extends ApplicationController
{
    public function index()
    {
        list($this->photos_pages, $this->photos) = $this->paginate(Photo::$objects->all(), 20);
    }
}

La méthode paginate() retourne un tableau contenant une instance de SPaginator ($this→photos_pages) ainsi qu'une instance de SQuerySet représentant la page en cours.

paginate(SQuerySet $query_set, $per_page=10, $param='page')
 
0_8/fr/pagination.txt · Last modified: 2009/04/03 02:27 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki