Pagination
Twitter bootstrap Documentation
Overview
Twitter bootstrap Documentation
- Result
- Source
<?php
// Create a paginator with 4 pages
$paginator = new \Laminas\Paginator\Paginator(new \Laminas\Paginator\Adapter\ArrayAdapter(array_fill(
0,
30,
true
)));
echo $this->paginationControl($paginator, null, null, [
'attributes' => ['aria-label' => 'Page navigation example'],
'previousLink' => 'Previous',
'nextLink' => 'Next',
]);
Working with icons
Twitter bootstrap Documentation
- Result
- Source
<?php
// Create a paginator with 4 pages
$paginator = new \Laminas\Paginator\Paginator(new \Laminas\Paginator\Adapter\ArrayAdapter(array_fill(
0,
30,
true
)));
echo $this->paginationControl($paginator, null, null, [
'previousLink' => [
'aria-label' => 'Previous',
'icon' => '«',
],
'nextLink' => [
'aria-label' => 'Next',
'icon' => '»',
],
'attributes' => ['aria-label' => 'Page navigation example'],
]);
Disabled and active states
Twitter bootstrap Documentation
- Result
- Source
<?php
// Create a paginator with 4 pages
$paginator = new \Laminas\Paginator\Paginator(new \Laminas\Paginator\Adapter\ArrayAdapter(array_fill(
0,
30,
true
)));
$paginator->setCurrentPageNumber(2);
echo $this->paginationControl($paginator, null, null, [
'attributes' => ['aria-label' => '...'],
'disabledStates' => true,
'activeStates' => true,
'previousLink' => 'Previous',
'previous' => null,
'nextLink' => 'Next',
]);
echo $this->paginationControl($paginator, null, null, [
'attributes' => ['aria-label' => '...'],
'disabledStates' => 'swap_out',
'activeStates' => 'swap_out',
'previousLink' => 'Previous',
'previous' => null,
'nextLink' => 'Next',
]);
Sizing
Twitter bootstrap Documentation
- Result
- Source
<?php
// Create a paginator with 4 pages
$paginator = new \Laminas\Paginator\Paginator(new \Laminas\Paginator\Adapter\ArrayAdapter(array_fill(
0,
30,
true
)));
echo $this->paginationControl($paginator, null, null, [
'size' => 'lg',
'attributes' => ['aria-label' => '...'],
'activeStates' => 'swap_out',
]);
echo $this->paginationControl($paginator, null, null, [
'size' => 'sm',
'attributes' => ['aria-label' => '...'],
'activeStates' => 'swap_out',
]);
Alignment
Twitter bootstrap Documentation
- Result
- Source
<?php
// Create a paginator with 4 pages
$paginator = new \Laminas\Paginator\Paginator(new \Laminas\Paginator\Adapter\ArrayAdapter(array_fill(
0,
30,
true
)));
echo $this->paginationControl($paginator, null, null, [
'disabledStates' => true,
'alignment' => 'center',
'previous' => null,
'previousLink' => 'Previous',
'nextLink' => 'Next',
'attributes' => ['aria-label' => 'Page navigation example'],
]);
echo $this->paginationControl($paginator, null, null, [
'disabledStates' => true,
'alignment' => 'end',
'previous' => null,
'previousLink' => 'Previous',
'nextLink' => 'Next',
'attributes' => ['aria-label' => 'Page navigation example'],
]);