PHP Класс 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
Наследование: extends sfPager, implements Serializable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$m_numPages
$m_offset
$m_offsets
$m_renderedStr
$m_selectedPageNumber
$m_urls

Открытые методы

Метод Описание
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.

Описание методов

SimplePager() публичный Метод

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() публичный Метод

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
Результат array

render() публичный Метод

Default way to render the links. Feel free to come up with your own way.
public render ( ) : string
Результат string

Описание свойств

$m_numPages публичное свойство

public $m_numPages

$m_offset публичное свойство

public $m_offset

$m_offsets публичное свойство

public $m_offsets

$m_renderedStr публичное свойство

public $m_renderedStr

$m_selectedPageNumber публичное свойство

public $m_selectedPageNumber

$m_urls публичное свойство

public $m_urls