Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | List of all members
paging_bar Class Reference
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. More...
 
 export_for_template (renderer_base $output)
 Export for template. More...
 
 prepare (renderer_base $output, moodle_page $page, $target)
 Prepares the paging bar for output. More...
 

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. More...
 
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. More...
 
string $pagevar
 This is the variable name that you use for the pagenumber in your code (ie. More...
 
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. More...
 

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: