Content / help / paginator-old-version .. concise-view << previous next >>

Previous older version paginatorDBe

Old DEPRECATED Paginator

Biscuits Pagination methods work on the following pagination properties

  1. totalRows The total number of rows selected.

    This is the total number of rows in before the views are split up and content is divided into views.

    A single-page view may have it's own SELECT with only those rows required for that page view.

  2. PageMaxRows The number of rows to display on a single page

Biscuits pagination must integrate with both the MVC view files and the controller that makes the original database selection. The SELECT statement returns the total row count. totalRows

View Files

Need to know the number of rows to display on the page and the navigation html to display at the foot of the view.

Example
$this->loadView('slide_list.php', array(
'result' => $result,
'rowsPerPage' => $this->paginator->rowsPerPage,
'navigation' => $this->paginator->navigation,
'query' => $query,
'error' => $result->error,
));

Original and subsequent SELECTs

The first SELECT will return the entire data set. This gives the paginator the value of, totRows. Subsequent views will only select the rows needed for that particular view and so this value will be passed through the final URL segment. All pagination properties needed for single-page views will be passed through the final URL segment, leaving all the other URL segments to fulfill there usual function.

The pagination properties passed through the URL segment will be hyphen delimited as follows: p-xx-yy-zz


start = (page - 1)*20 ;
end = 20 * page;
select * from table limit (start, end);

LIMIT
With two arguments, the first argument specifies the offset of the first row to return, and the second specifies the maximum number of rows to return. The offset of the initial row is 0 (not 1):
SELECT * FROM tbl LIMIT 5,10; # Retrieve rows 6-15





iBiscuits LOGO