Pager
[ class tree: Pager ] [ index: Pager ] [ all elements ]

Class: Pager_Jumping

Source Location: /Pager-2.4.9/Pager/Jumping.php

Class Overview

Pager_Common
   |
   --Pager_Jumping

Pager_Jumping - Generic data paging class ("jumping window" style) Handles paging a set of data. For usage see the example.php provided.


Author(s):

Copyright:

  • 2003-2008 Lorenzo Alberton, Richard Heyes

Methods


Inherited Variables

Inherited Methods

Class: Pager_Common

Pager_Common::build()
Generate or refresh the links and paged data after a call to setOptions()
Pager_Common::errorMessage()
Return a textual error message for a PAGER error code
Pager_Common::getCurrentPageID()
Returns ID of current page
Pager_Common::getLinks()
Returns back/next/first/last and page links, both as ordered and associative array.
Pager_Common::getNextPageID()
Returns next page ID. If current page is last page this function returns FALSE
Pager_Common::getOffsetByPageId()
Returns offsets for given pageID. Eg, if you pass it pageID one and your perPage limit is 10 it will return (1, 10). PageID of 2 would give you (11, 20).
Pager_Common::getOption()
Return the current value of a given option
Pager_Common::getOptions()
Return an array with all the current pager options
Pager_Common::getPageData()
Returns an array of current pages data
Pager_Common::getPageIdByOffset()
Returns pageID for given offset
Pager_Common::getPageRangeByPageId()
Given a PageId, it returns the limits of the range of pages displayed.
Pager_Common::getPageSelectBox()
Returns a string with a XHTML SELECT menu with the page numbers, useful as an alternative to the links
Pager_Common::getPerPageSelectBox()
Returns a string with a XHTML SELECT menu,
Pager_Common::getPreviousPageID()
Returns previous page ID. If current page is first page this function returns FALSE
Pager_Common::isFirstPage()
Returns whether current page is first page
Pager_Common::isLastPage()
Returns whether current page is last page
Pager_Common::isLastPageComplete()
Returns whether last page is complete
Pager_Common::numItems()
Returns number of items
Pager_Common::numPages()
Returns number of pages
Pager_Common::setOptions()
Set and sanitize options

Class Details

[line 57]
Pager_Jumping - Generic data paging class ("jumping window" style) Handles paging a set of data. For usage see the example.php provided.


[ Top ]


Method Detail

Pager_Jumping (Constructor)   [line 68]

Pager_Jumping Pager_Jumping( [array $options = array()])

Constructor
  • Access: public

Parameters:

array   $options     Associative array of option names and their values

[ Top ]

getLinks   [line 156]

array getLinks( [integer $pageID = null], [string $next_html = ''])

Returns back/next/first/last and page links, both as ordered and associative array.

NB: in original PEAR::Pager this method accepted two parameters, $back_html and $next_html. Now the only parameter accepted is an integer ($pageID), since the html text for prev/next links can be set in the constructor. If a second parameter is provided, then the method act as it previously did. This hack's only purpose is to mantain backward compatibility.

  • Return: Back/pages/next links

Overrides Pager_Common::getLinks() (Returns back/next/first/last and page links, both as ordered and associative array.)

Parameters:

integer   $pageID     Optional pageID. If specified, links for that page are provided instead of current one. [ADDED IN NEW PAGER VERSION]
string   $next_html     HTML to put inside the next link [deprecated: use the factory instead]

[ Top ]

getPageIdByOffset   [line 87]

int getPageIdByOffset( integer $index)

Returns pageID for given offset
  • Return: PageID for given offset

Overrides Pager_Common::getPageIdByOffset() (Returns pageID for given offset)

Parameters:

integer   $index     Offset to get pageID for

[ Top ]

getPageRangeByPageId   [line 118]

array getPageRangeByPageId( [integer $pageid = null])

Given a PageId, it returns the limits of the range of pages displayed.

While getOffsetByPageId() returns the offset of the data within the current page, this method returns the offsets of the page numbers interval. E.g., if you have pageId=3 and delta=10, it will return (1, 10). PageID of 8 would give you (1, 10) as well, because 1 <= 8 <= 10. PageID of 11 would give you (11, 20). If the method is called without parameter, pageID is set to currentPage#.

  • Return: First and last offsets
  • Access: public

Overrides Pager_Common::getPageRangeByPageId() (Given a PageId, it returns the limits of the range of pages displayed.)

Parameters:

integer   $pageid     PageID to get offsets for

[ Top ]


Documentation generated on Wed, 14 May 2014 10:00:05 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.