Pager_Sliding::getOffsetByPageId

Pager_Sliding::getOffsetByPageId() – Returns offsets for given pageID.

Synopsis

require_once 'Pager/Sliding.php';

array Pager_Sliding::getOffsetByPageId ( integer $pageid = null )

Description

Eg, if you pass it pageID = 5 and your delta is 2 it will return you 3 and 7. PageID of 6 would give you 4 and 8

NB: The behaviour of this function could be misleading: it was left only for compatibility with PEAR::Pager. It could raise some confusion when pageID is within delta positions from an extreme: in fact this method returns also the extremes, while $this->_getPageLinks leaves them out. Pager_Sliding works this way: if pageID is NOT an extreme, show first and last page within brackets: [1] << 5 | _6_ | 7 >> [15] So when dealing with pageID within delta positions from an extreme, this method would return the extreme as well, while $this->_getPageLinks would return (for instance) 2 | _3_ | 4 | 5 even if pageID is 3 and delta is 2. Consider this method deprecated and/or subject to changes.

Parameter

  • integer $pageid - PageID to get offsets for

Return value

return array with first and last offsets

Deprecated

deprecated