previousPager::getPageRangeByPageId (Previous) (Next) Pager::getPreviousPageIDnext

View this page in Last updated: Sun, 21 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Pager::getPageSelectBox

Pager::getPageSelectBox() – 表示するページを選択するための XHTML SELECT メニュー文字列を返す

Synopsis

require_once 'Pager.php';

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

Parameter

  • array $params (オプション)

    • 'optionText' : 各選択肢に表示するテキスト。 ページ番号を表示させたい場合は '%d' を使用します。

    • 'autoSubmit' : true にすると、 js コードを追加して onChange イベントでフォームを送信できるようにhします。

  • string $extraAttributes (html 属性) タグの属性あるいは HTML の属性 (id="foo" 形式) で、<select> タグに追加されるもの。

Description

ページ番号を指定する XHTML SELECT メニュー文字列を返します。 リンクのかわりに使用することができます。

この例では、select ボックスを使用してユーザが移動先ページを指定できるようにしています。

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

Return value

XHTML SELECT メニューを文字列で返します。

previousPager::getPageRangeByPageId (Previous) (Next) Pager::getPreviousPageIDnext

Download Documentation Last updated: Sun, 21 Jun 2009
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.