JavaScript Editor Javascript validator     Web page editor 



Pager::getPageSelectBox()

Pager::getPageSelectBox() -- Returns a string with a XHTML SELECT menu, to choose the page to display.

Synopsis

require_once 'Pager.php';

array Pager::getPageSelectBox ([array $params [, string $extraAttributes = '']])

Parameter

Description

Returns a string with a XHTML SELECT menu with the page numbers, useful as an alternative to the links

Example

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

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

$selectBoxParams = array(
    'optionText' => 'page %d',
    'autoSubmit' => true,
);
$selectBox = $pager->getPageSelectBox();

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

Return value

return string with the XHTML SELECT menu.




JavaScript Editor Javascript validator     Web page editor