mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
Add Controller::createPaginationControl()
This commit is contained in:
parent
a6d65bb375
commit
3dfd8ba0f9
1 changed files with 19 additions and 0 deletions
|
|
@ -4,9 +4,11 @@ namespace Icinga\Module\Eagle\Web;
|
|||
|
||||
use Icinga\Data\ResourceFactory;
|
||||
use Icinga\Module\Eagle\Widget\ViewModeSwitcher;
|
||||
use ipl\Stdlib\Contract\PaginationInterface;
|
||||
use ipl\Web\Compat\CompatController;
|
||||
use ipl\Sql\Connection;
|
||||
use ipl\Web\Control\LimitControl;
|
||||
use ipl\Web\Control\PaginationControl;
|
||||
use ipl\Web\Url;
|
||||
|
||||
class Controller extends CompatController
|
||||
|
|
@ -73,6 +75,23 @@ class Controller extends CompatController
|
|||
return $limitControl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and return the PaginationControl
|
||||
*
|
||||
* This automatically shifts the pagination URL parameters from {@link $params}.
|
||||
*
|
||||
* @return PaginationControl
|
||||
*/
|
||||
public function createPaginationControl(PaginationInterface $paginatable)
|
||||
{
|
||||
$paginationControl = new PaginationControl($paginatable, Url::fromRequest());
|
||||
|
||||
$this->params->shift($paginationControl->getPageParam());
|
||||
$this->params->shift($paginationControl->getPageSizeParam());
|
||||
|
||||
return $paginationControl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and return the ViewModeSwitcher
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue