Pagination

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')
 
fr/pagination.txt · Last modified: 2008/01/25 12:49