LemonStand Documentation

Phpr_Pagination

Phpr_Pagination class is an general purpose class allowing to paginate a list of records, including the database records. Usually you will not need to create instances of this class manually, because the Db_ActiveRecord class, which is a parent class of many other LemonStand classes, has the paginate method, which creates an instance of the Phpr_Pagination class for you.

Class methods

  • __construct($rows_per_page = 20) – the class constructor. Creates a class instance and set the number of rows on a page.
  • setCurrentPageIndex($page_index) – sets an index of a current page. The pages indexes are zero-based
  • getCurrentPageIndex() - returns an index of a current page
  • setPageSize($rows_per_page) - sets a number of rows in a single page
  • getPageSize() - returns a number of rows on a single page
  • setRowCount($num) – sets a total number of rows
  • getRowCount() - returns a total number of rows
  • getFirstPageRowIndex() - returns an index of the first row on a current page
  • getLastPageRowIndex() - returns an index of a last row on a current page
  • getPageCount() - returns a total number of pages
  • limitActiveRecord($active_record_obj) – allows to limit a number of rows returned by the Db_ActiveRecord find_all method to a single page. In the most cases you can use the Db_ActiveRecord paginate method instead of the limitActiveRecord method.

Next: Cms_Controller
Previous: Phpr_DateTime
Return to Reference

Comments

No comments posted so far.

Add your comment

Loading form...