Set WeberTrivia.com to be my default homepage.   Suggest a Question                                               

Suggest A Question : :  Frequently Asked Questions : :  Search : :  Relevant Manuals : : 
PHP Questions : :  Linux Questions : :  MySQL Questions : : 
home  [ Login ] 

Pager::getperpageselectbox()

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

Parameter

  • integer $start - Min. number of items per page (optional) integer $end - Max. number of items per page (optional) integer $step - Increment between two options (optional)

Description

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 = &new Pager($params);    $selectBox = $pager->getPerPageSelectBox();  echo '<form action="'.$_SERVER['PHP_SELF'].'" method="GET">'; echo $selectBox; echo '<input type="submit" value="submit" />'; echo '</form>';

Return value

return string with the XHTML SELECT menu.

Who's Online
Guest Users: 9
Google
Web
WeberTrivia
WeberDev
WeberForums
 Free Sample Chapters  Free Sample Chapters
  Deliver First Class Web Sites: 101 Essential Checklists
Want to learn how to make your web sites usable and accessible? Want to ensure that your sites meet current best practice, without spending hours trawling through incomprehensible specifications and recommendations from dozens of different books, research papers, and web sites? Want to make sure that the sites you build are "right the first time," requiring no costly redevelopments?

More Sample Chapters

PHP General