Pager::getPageRangeByPageId (Previous) (Next) Pager::getPreviousPageID

View this page in Last updated: Sun, 31 Aug 2008
English | French | German | Japanese | Plain HTML

Pager::getPageSelectBox()

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

Paramètres

  • array $params (optional)

    • 'optionText': text to show in each option. Use '%d' where you want to see the number of the page.

    • 'autoSubmit': if true, add some js code to submit the form on the onChange event

  • string $extraAttributes (html attributes) Tag attributes or HTML attributes (id="foo" pairs), will be inserted in the <select> tag.

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.


<?php
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>';
?>

Valeur retournée

return string with the XHTML SELECT menu.

Pager::getPageRangeByPageId (Previous) (Next) Pager::getPreviousPageID

Download Documentation Last updated: Sun, 31 Aug 2008
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.