forked from holubj/NiftyGrid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGridPaginator.php
More file actions
45 lines (39 loc) · 838 Bytes
/
Copy pathGridPaginator.php
File metadata and controls
45 lines (39 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* NiftyGrid - DataGrid for Nette
*
* @author Jakub Holub
* @copyright Copyright (c) 2012 Jakub Holub
* @license New BSD Licence
* @link http://addons.nette.org/cs/niftygrid
*/
namespace NiftyGrid;
use Nette\Utils\Paginator;
class GridPaginator extends \Nette\Application\UI\Control
{
/** @persistent int */
public $page = 1;
/**
* @var Paginator
*/
public $paginator;
public function __construct()
{
parent::__construct();
$this->paginator = new Paginator;
}
public function render()
{
$this->template->paginator = $this->paginator;
$this->template->setFile(dirname(__FILE__) . '/templates/paginator.latte');
$this->template->render();
}
/**
* @param array $params
*/
public function loadState(array $params)
{
parent::loadState($params);
$this->paginator->page = $this->page;
}
}