Pager::getPerPageSelectBox()

Pager::getPerPageSelectBox() -- Returns a string with a XHTML SELECT menu, to choose how many items per page should be displayed.

Synopsis

require_once 'Pager.php';

array Pager::getPerPageSelectBox ([integer $start = 5 [, integer $end = 30 [, integer $step = 5 [, boolean $showAllData = false [, string $optionText = '%d']]]]])

ðÁÒÁÍÅÔÒ

ïÐÉÓÁÎÉÅ

Returns a string with a XHTML SELECT menu, useful for letting the user choose how many items per page should be displayed. If parameter useSessions is TRUE, this value is stored in a session var. The string isn't echoed right away so you can use it with template engines.

Example

This example shows how you can create a select box to let your users choose the number of items to display on each page.
include 'Pager/Pager.php';

$params = array(
    'mode'       => 'Jumping',
    'perPage'    => 3,
    'delta'      => 2,
    'itemData'   => array('a','b','c','d','e',[...omissis...],'z')
);
$pager = & Pager::factory($params);

$selectBox = $pager->getPerPageSelectBox();

echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="GET">';
echo $selectBox;
echo '<input type="submit" value="submit" />';
echo '</form>';

÷ÏÚ×ÒÁÝÁÅÍÏÅ ÚÎÁÞÅÎÉÅ

return string with the XHTML SELECT menu.


HIVE: All information for read only. Please respect copyright!
Hosted by hive ÊÃÁ: Êèåâñêàÿ ãîðîäñêàÿ áèáëèîòåêà