Views: 1627
Rating: 4

TPagination

Submitted By: marcus
Licence: PRADO

Component for pagination lists on the page.

Files
10.16 KB
174 downloads
TPagination.php



Info

Overview

This is originally based on a 2.x control (I think) by Vegard Hanssen. It has been modified to use GET parameters for switching around pages due to POST being a bit cumbersome sometimes. NOTE: While it has a definition for an event, it's not actually triggered anymore!


Installation / Usage

 <com:TPagination PrevText="&laquo;" NextText="&raquo;" Limit="5" ID="resultPage" />

In code:

  $this->resultPage->setStart(0);
  
  $itemCount = count($items);
  $this->resultPage->setStop($itemCount);
  
  $limit = $this->resultPage->getLimit();
  $start = $limit * ($this->resultPage->getCurrent()-1);
  $sql = "SELECT * FROM Sample LIMIT $start, $limit";



Please note: This is currently a beta preview and has known bugs. Please see the PRADO forums if you have suggestions or problems using it.