PEAR Pager

From Triangle Wiki

Jump to: navigation, search

Introduction

Produce a paged result set.

Usage

To show the links within the admin or hopefully any other Triangle developed site use the following calls.

First include the Paging script:

require_once COMMON_PATH . 'Pager/Pager.php';

Initiate the Pager class and override any of the default parameters within it, the totalItems or itemData are required options.

$params = array('totalItems'=>$sql->N, 'perPage'=>25);
$paging = new Common_Pager($params);

Process the DataObjects wrapper, passing in the SQL object.

$paged_data = $paging->pagerWrapperDBDO($sql1);

Show the links with the following call, passing and overriding any language options within the pager.

echo $pageIt = $paging->showPagerLinks($paged_data, $language);

External Links

Personal tools