PHP Class SimplePager

Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com OrangeHRM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Inheritance: extends sfPager, implements Serializable
Mostrar archivo Open project: sourcefabric/newscoop Class Usage Examples

Public Properties

Property Type Description
$m_numPages
$m_offset
$m_offsets
$m_renderedStr
$m_selectedPageNumber
$m_urls

Public Methods

Method Description
SimplePager ( integer $p_totalItems, integer $p_itemsPerPage, string $p_offsetVarName, string $p_baseUrl, boolean $p_useSessions = true, $p_width = 10 ) SimplePager, unlike the PEAR Pager class, is a pager made to work with template-like layouts. The constructor sets up the variables you need to render the links, and you can render them however you like. There is a default render function for reference.
_range ( integer $p_num1, integer $p_num2, integer $p_step = 1 ) : array Create an array of integers starting at $p_num1 and ending at $p_num2 (inclusive), going up by a value of $p_step each time.
render ( ) : string Default way to render the links. Feel free to come up with your own way.

Method Details

SimplePager() public method

SimplePager, unlike the PEAR Pager class, is a pager made to work with template-like layouts. The constructor sets up the variables you need to render the links, and you can render them however you like. There is a default render function for reference.
public SimplePager ( integer $p_totalItems, integer $p_itemsPerPage, string $p_offsetVarName, string $p_baseUrl, boolean $p_useSessions = true, $p_width = 10 )
$p_totalItems integer Total number of items.
$p_itemsPerPage integer Number of items to display per page.
$p_offsetVarName string The name of the REQUEST variable which holds the order number of the first item on the selected page.
$p_baseUrl string The url to which we attach the offset variable name.
$p_useSessions boolean Set to TRUE if you want the offset item number to be stored in the session so that the user will return to their previous position in the pager when they leave the screen and come back to it.

_range() public method

Create an array of integers starting at $p_num1 and ending at $p_num2 (inclusive), going up by a value of $p_step each time.
public _range ( integer $p_num1, integer $p_num2, integer $p_step = 1 ) : array
$p_num1 integer
$p_num2 integer
$p_step integer
return array

render() public method

Default way to render the links. Feel free to come up with your own way.
public render ( ) : string
return string

Property Details

$m_numPages public_oe property

public $m_numPages

$m_offset public_oe property

public $m_offset

$m_offsets public_oe property

public $m_offsets

$m_renderedStr public_oe property

public $m_renderedStr

$m_selectedPageNumber public_oe property

public $m_selectedPageNumber

$m_urls public_oe property

public $m_urls