Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
Pagination Class Reference

Public Member Functions

 asDialog ($content= '')
 
 getTotal ()
 
 getCurrentPage ()
 
 getOffset ()
 
 getPerPage ()
 
 getPageCount ()
 
 asButtons ($name= 'page')
 
 asLinks (Closure $link_for=null)
 
 loadSORMCollection ($sorm_class, $condition= '1', array $parameters=[])
 

Static Public Member Functions

static create ($total, $current_page=0, $per_page=null)
 

Detailed Description

Pagination abstraction

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m GPL2 or any later version
Since
Stud.IP 4.4

Member Function Documentation

asButtons (   $name = 'page')

Renders the paginations with <button> elements.

Parameters
string$nameValue of the button's name attribute
Returns
string html
asDialog (   $content = '')

Add dialog options

Parameters
string$contentParameters for data-dialog attribute
Returns
Pagination instance to allow chaining
asLinks ( Closure  $link_for = null)

Renders the paginations with link elements.

Parameters
Closure$link_forOptional generator for page links (defaults to links to the current page with ?page= parameters)
Returns
string html
static create (   $total,
  $current_page = 0,
  $per_page = null 
)
static

Creates a pagination object.

Parameters
int$totalTotal number of entries
int$current_pageCurrent page
int$per_pageDisplayed entries per page
Returns
Pagination object
getCurrentPage ( )

Returns the current page

Returns
int
getOffset ( )

Returns the current offset or skipped entries before the current page.

Returns
int
getPageCount ( )

Get total number of pages.

Returns
int
getPerPage ( )

Returns the maximum number of entries per page.

Returns
int
getTotal ( )

Returns the total number of entries.

Returns
int
loadSORMCollection (   $sorm_class,
  $condition = '1',
array  $parameters = [] 
)

Loads the slice of a sorm collection defined by this object.

Parameters
string$sorm_className of the SORM class
string$conditionCondition to load objects by
array$parametersAdditional parameters for the condition
Returns
SimpleORMapCollection
Exceptions

The documentation for this class was generated from the following file: