1 | <?php |
||
23 | class PageSizePager extends LinkPager |
||
24 | { |
||
25 | /** |
||
26 | * Page size list |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | public $pageSizeList = [10, 20, 30, 50]; |
||
31 | |||
32 | /** |
||
33 | * Grid id |
||
34 | * |
||
35 | * @var null |
||
36 | */ |
||
37 | public $gridIdentifier = null; |
||
38 | |||
39 | /** |
||
40 | * pageSize style |
||
41 | */ |
||
42 | public $pageSizeOptions = [ |
||
43 | 'class' => 'form-control', |
||
44 | 'style' => 'display: inline-block; vertical-align: top; width: auto; margin: 20px 0;', |
||
45 | ]; |
||
46 | |||
47 | /** |
||
48 | * Current page size |
||
49 | * |
||
50 | * @var int |
||
51 | */ |
||
52 | protected $pageSize; |
||
53 | |||
54 | /** |
||
55 | * @var ProviderInterface |
||
56 | */ |
||
57 | protected $provider; |
||
58 | |||
59 | public function __construct(ProviderInterface $provider, array $config = []) |
||
65 | |||
66 | /** |
||
67 | * Run widget |
||
68 | */ |
||
69 | public function init() |
||
79 | |||
80 | /** |
||
81 | * Render page size |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | protected function renderPageSize() |
||
95 | |||
96 | /** |
||
97 | * Get filter selector using ActiveDataProvider |
||
98 | * |
||
99 | * @param DataProviderInterface $dataProvider |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | public static function getFilterSelector(DataProviderInterface $dataProvider): string |
||
107 | } |
||
108 |