PhpLight
[ class tree: PhpLight ] [ index: PhpLight ] [ all elements ]

Class: PhpLight_Pagination_Abstract

Source Location: /Pagination/Abstract.php

Class Overview


Abstract pagination


Author(s):

  • Indiana Jones

Version:

  • 1.0

Variables

Methods


Child classes:

PhpLight_Pagination_Simple
Simple pagination

Class Details

[line 18]
Abstract pagination

$Id: Abstract.php 529 2011-10-07 05:00:05Z indy $

$LastChangedBy: indy $

$LastChangedDate: 2011-10-07 08:00:05 +0300 (Fri, 07 Oct 2011) $

$Rev: 529 $




Tags:

author:  Indiana Jones
version:  1.0
abstract:  


[ Top ]


Class Variables

$_config = array(
        PhpLight_Pagination::OPT_URL_PATTERN => '<a href="index.php?page=%iterator%&amp;%query_vars%">%text%</a>',
        PhpLight_Pagination::OPT_URL_PATTERN_CURRENT => '<b>%iterator%</b>',
        PhpLight_Pagination::OPT_ITEMS_PER_PAGE => 10,
        PhpLight_Pagination::OPT_CURRENT_PAGE => 1,
        PhpLight_Pagination::OPT_ITEMS_COUNT => 0,
        PhpLight_Pagination::OPT_DISPLAY_NEXT => true,
        PhpLight_Pagination::OPT_DISPLAY_PREVIOUS => true,
        PhpLight_Pagination::OPT_NEXT_TEXT => 'Next',
        PhpLight_Pagination::OPT_PREVIOUS_TEXT => 'Previous',
        PhpLight_Pagination::OPT_DISPLAY_FIRST => false,
        PhpLight_Pagination::OPT_DISPLAY_LAST => false,
        PhpLight_Pagination::OPT_FIRST_TEXT => 'First page',
        PhpLight_Pagination::OPT_LAST_TEXT => 'Last page',
        PhpLight_Pagination::OPT_ITEMS_AROUND => 3,
        PhpLight_Pagination::OPT_ITEMS_START_END => 3,
        PhpLight_Pagination::OPT_QUERY_VARS => array(),PhpLight_Pagination::OPT_ITEMS_SEPARATOR=>' ',PhpLight_Pagination::OPT_MORE_SEPARATOR=>' ... ')

[line 25]

Configuration



Tags:

access:  protected

Type:   array


[ Top ]

$_lowerLimit =  0

[line 51]

Lower limit



Tags:

access:  protected

Type:   integer


[ Top ]

$_pagination =

[line 65]

Pagination result



Tags:

access:  protected

Type:   string


[ Top ]

$_totalPages =  1

[line 72]

Total number of pages



Tags:

access:  protected

Type:   integer


[ Top ]

$_upperLimit =  0

[line 58]

Upper limit



Tags:

access:  protected

Type:   integer


[ Top ]



Class Methods


constructor __construct [line 80]

void __construct( [ $config = array()])

Constructor



Tags:

access:  public


Parameters:

array   $config  

[ Top ]

method getLowerLimit [line 115]

integer getLowerLimit( )

Get lower limit



Tags:

access:  public


[ Top ]

method getNextPage [line 264]

integer|null getNextPage( $pageNumber)

Get next page



Tags:

access:  public


Parameters:

   $pageNumber  

[ Top ]

method getPagination [line 145]

string getPagination( )

Get the pagination



Tags:

access:  public


[ Top ]

method getPreviousPage [line 280]

integer|null getPreviousPage( $pageNumber)

Get previous page



Tags:

access:  public


Parameters:

   $pageNumber  

[ Top ]

method getTotal [line 135]

integer getTotal( )

Get the total number of pages



Tags:

access:  public


[ Top ]

method getUpperLimit [line 125]

integer getUpperLimit( )

Get upper limit



Tags:

access:  public


[ Top ]

method setConfig [line 92]

void setConfig( [ $config = array()])

Set config



Tags:

access:  public


Parameters:

array   $config  

[ Top ]

method _addItem [line 385]

void _addItem( string $item)

Add item to pagination



Tags:

access:  protected


Parameters:

string   $item  

[ Top ]

method _buildCurrentPageLink [line 323]

string _buildCurrentPageLink( integer $pageNumber)

Build page link for current page



Tags:

access:  protected


Parameters:

integer   $pageNumber  

[ Top ]

method _buildPageLink [line 308]

string _buildPageLink( integer $pageNumber, [string|null $text = null])

Build page link



Tags:

access:  protected


Parameters:

integer   $pageNumber  
string|null   $text  

[ Top ]

method _buildPagination [line 158]

void _buildPagination( )

Get pagination



Tags:

abstract:  
access:  protected


Overridden in child classes as:

PhpLight_Pagination_Simple::_buildPagination()
Build pagination

[ Top ]

method _computeLimits [line 219]

void _computeLimits( )

Compute limits



Tags:

access:  protected


[ Top ]

method _computeTotal [line 296]

void _computeTotal( )

Compute total number of pages



Tags:

access:  protected


[ Top ]

method _formatQueryVars [line 371]

string _formatQueryVars( )

Format query variables



Tags:

access:  protected


[ Top ]

method _isFirstPage [line 240]

boolean _isFirstPage( )

Is current page the first one



Tags:

access:  protected


[ Top ]

method _isLastPage [line 252]

boolean _isLastPage( )

Is current page the last one



Tags:

access:  protected


[ Top ]

method _replacePatterns [line 348]

string _replacePatterns( string $string, integer $pageNumber, [string|null $text = null])

Replace patterns

Accepted patterns:

  • %iterator%
  • %total_pages%
  • %first_page%
  • %last_page%
  • %previous%
  • %next%




Tags:

access:  protected


Parameters:

string   $string  
integer   $pageNumber  
string|null   $text  

[ Top ]

method _validateConfig [line 167]

void _validateConfig( $config)

Validate given config



Tags:

throws:  PhpLight_Exception
access:  protected


Parameters:

array   $config  

[ Top ]

method _validateCurrent [line 395]

void _validateCurrent( )

Validate current page number



Tags:

access:  protected


[ Top ]


Documentation generated on Fri, 07 Oct 2011 08:06:17 +0300 by phpDocumentor 1.4.3