Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
paging_bar Class Reference

Component representing a paging bar. More...

Inheritance diagram for paging_bar:
renderable templatable

Public Member Functions

 __construct ($totalcount, $page, $perpage, $baseurl, $pagevar='page')
 Constructor paging_bar with only the required params.
 
 export_for_template (renderer_base $output)
 Export for template.
 
 prepare (renderer_base $output, moodle_page $page, $target)
 Prepares the paging bar for output.
 

Public Attributes

string moodle_url $baseurl
 If this is a string then it is the url which will be appended with $pagevar, an equals sign and the page number.
 
string $firstlink = null
 A HTML link representing the first page.
 
string $lastlink = null
 A HTML link representing the last page.
 
int $maxdisplay = 18
 The maximum number of pagelinks to display.
 
string $nextlink = null
 A HTML link representing the "next" page.
 
int $page
 The page you are currently viewing.
 
array $pagelinks = array()
 An array of strings.
 
string $pagevar
 This is the variable name that you use for the pagenumber in your code (ie.
 
int $perpage
 The number of entries that should be shown per page.
 
string $previouslink = null
 A HTML link representing the "previous" page.
 
int $totalcount
 The total number of entries to be pages through.
 

Detailed Description

Component representing a paging bar.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Since
Moodle 2.0

Constructor & Destructor Documentation

◆ __construct()

paging_bar::__construct ( $totalcount,
$page,
$perpage,
$baseurl,
$pagevar = 'page' )

Constructor paging_bar with only the required params.

Parameters
int$totalcountThe total number of entries available to be paged through
int$pageThe page you are currently viewing
int$perpageThe number of entries that should be shown per page
string | moodle_url$baseurlurl of the current page, the $pagevar parameter is added
string$pagevarname of page parameter that holds the page number

Member Function Documentation

◆ export_for_template()

paging_bar::export_for_template ( renderer_base $output)

Export for template.

Parameters
renderer_base$outputThe renderer.
Return values
stdClass

Implements templatable.

◆ prepare()

paging_bar::prepare ( renderer_base $output,
moodle_page $page,
$target )

Prepares the paging bar for output.

This method validates the arguments set up for the paging bar and then produces fragments of HTML to assist display later on.

Parameters
renderer_base$output
moodle_page$page
string$target
Exceptions
coding_exception

Member Data Documentation

◆ $baseurl

string moodle_url paging_bar::$baseurl

If this is a string then it is the url which will be appended with $pagevar, an equals sign and the page number.

If this is a moodle_url object then the pagevar param will be replaced by the page no, for each page.

◆ $pagelinks

array paging_bar::$pagelinks = array()

An array of strings.

One of them is just a string: the current page

◆ $pagevar

string paging_bar::$pagevar

This is the variable name that you use for the pagenumber in your code (ie.

'tablepage', 'blogpage', etc)

◆ $totalcount

int paging_bar::$totalcount

The total number of entries to be pages through.


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