ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
many_pages.php File Reference

Go to the source code of this file.

Functions

 many_pages ()
 

Function Documentation

◆ many_pages()

many_pages ( )

Definition at line 3 of file many_pages.php.

References $_GET, $DIC, $factory, $result, and $url.

4 {
5  global $DIC;
6  $factory = $DIC->ui()->factory();
7  $renderer = $DIC->ui()->renderer();
8  $url = $DIC->http()->request()->getRequestTarget();
9 
10  $parameter_name = 'page2';
11  $current_page = (int) (array_key_exists($parameter_name, $_GET) ? $_GET[$parameter_name] : 0);
12 
13  $pagination = $factory->viewControl()->pagination()
14  ->withTargetURL($url, $parameter_name)
15  ->withTotalEntries(1000)
16  ->withPageSize(2)
17  ->withMaxPaginationButtons(5)
18  ->withCurrentPage($current_page);
19 
20  list($range_offset, $range_length) = $pagination->getRange()->unpack();
21  $result = "Show $range_length entries starting at $range_offset";
22 
23  return $renderer->render($pagination)
24  . '<hr>'
25  . $result;
26 }
$result
$_GET["client_id"]
global $DIC
Definition: goto.php:24
$url
$factory
Definition: metadata.php:58