Lambda-lib
[ class tree: Lambda-lib ] [ index: Lambda-lib ] [ all elements ]

Class: Pager2

Source Location: /libs/Pager2.php

Class Overview


Pager2 Class


Author(s):

  • rooth

Version:

  • 0.0.1

    PHP version 5

     [usage]
    
       === PHP ===
       // RPP
       define('RPP', 10);
    
       // ページ番号初期化, offset, limit
       $page   = $lmd->getHttpGet('page', 1, '/^[0-9]+$/');
       $offset = ($page - 1) * RPP;
       $limit  = RPP;
    
       // get data
       $dao = Factory::load('DB/DAO_hoge')->getInstance();
       $res = $dao->fetchAll($offset, $limit);
       $total_rows = $dao->foundRows();
    
       // asign Pager
       Factory::import('Pager');
       $lmd->setResponse(array(
           'pager' => Pager::GETParam($page, $limit, $total_rows)
       ), Lambda::INSANITATION);
    
       === HTML ===
       
       
       
    <!-- pager --> <link type="text/css" rel="stylesheet" href="<?= APP_ROOT ?>/css/Pager/skyblue.css"> <div id="pager"><div class="mtop mbot"><?php echo $pager ?></div></div> <!-- pager -->

Variables

Methods



Class Details

[line 49]
Pager2 Class



Tags:

author:  rooth
version:  

0.0.1

PHP version 5

 [usage]

   === PHP ===
   // RPP
   define('RPP', 10);

   // ページ番号初期化, offset, limit
   $page   = $lmd->getHttpGet('page', 1, '/^[0-9]+$/');
   $offset = ($page - 1) * RPP;
   $limit  = RPP;

   // get data
   $dao = Factory::load('DB/DAO_hoge')->getInstance();
   $res = $dao->fetchAll($offset, $limit);
   $total_rows = $dao->foundRows();

   // asign Pager
   Factory::import('Pager');
   $lmd->setResponse(array(
       'pager' => Pager::GETParam($page, $limit, $total_rows)
   ), Lambda::INSANITATION);

   === HTML ===
   
   
   
<!-- pager --> <link type="text/css" rel="stylesheet" href="<?= APP_ROOT ?>/css/Pager/skyblue.css"> <div id="pager"><div class="mtop mbot"><?php echo $pager ?></div></div> <!-- pager -->



[ Top ]


Class Variables

static $modulus =

[line 54]



Tags:

access:  protected

Type:   mixed


[ Top ]

static $page =

[line 51]



Tags:

access:  protected

Type:   mixed


[ Top ]

static $page_total =

[line 55]



Tags:

access:  protected

Type:   mixed


[ Top ]

static $rows_per_page =

[line 52]



Tags:

access:  protected

Type:   mixed


[ Top ]

static $rows_total =

[line 53]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


static method getPageTotal [line 151]

static void getPageTotal( )



Tags:

access:  protected


[ Top ]

static method GETParam [line 74]

static str GETParam( int $page, int $rows_per_page, int $rows_total, [int $modulus = 11], [ $opt = array()])

GET パラメータ ぺージャ



Tags:

return:  ページャ文字列(リンク付き)
access:  public


Parameters:

int   $page   現在のページ番号(初期値は1)
int   $rows_per_page   1ページに表示するリスト件数
int   $rows_total   合計レコード数
int   $modulus   最大何ページ分のページ番号を並べるか(奇数で定義。5以上)
array   $opt   array( 'param_name' => パラメータ名, // def: page 'delimiter' => ページ番号の区切り文字, // def: ' | ' 'separator' => 最初/最後ページの区切り文字, // def: ' … ' )

[ Top ]

static method init [line 139]

static void init( $page, $rows_per_page, $rows_total, $modulus)



Tags:

access:  protected


Parameters:

   $page  
   $rows_per_page  
   $rows_total  
   $modulus  

[ Top ]

static method pager [line 156]

static void pager( $path, $opt, [ $extension = ''])



Tags:

access:  protected


Parameters:

   $path  
   $opt  
   $extension  

[ Top ]

static method SEO [line 111]

static str SEO( int $page, int $rows_per_page, int $rows_total, [int $modulus = 11], [ $opt = array()])

SEO ぺージャ



Tags:

return:  ページャ文字列(リンク付き)
access:  public


Parameters:

int   $page   現在のページ番号(初期値は1)
int   $rows_per_page   1ページに表示するリスト件数
int   $rows_total   合計レコード数
int   $modulus   最大何ページ分のページ番号を並べるか(奇数で定義。5以上)
array   $opt   array( 'param_name' => パラメータ名, // def: 'p' 'param_name' => パラメータ区切り文字, // def: '/' 'param_name' => パラメータ連結文字, // def: '_' 'delimiter' => ページ番号の区切り文字, // def: ' | ' 'separator' => 最初/最後ページの区切り文字, // def: ' … ' 'extension' => 拡張子, // def: '.html' )

[ Top ]


Documentation generated on Sat, 21 May 2011 18:34:08 +0900 by phpDocumentor 1.4.1