1 | <?php |
||
36 | class Control extends Application\UI\Control |
||
37 | { |
||
38 | /** |
||
39 | * @persistent int |
||
40 | */ |
||
41 | public $page = 1; |
||
42 | |||
43 | /** |
||
44 | * Events |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | public $onShowPage; |
||
49 | |||
50 | /** |
||
51 | * @var Utils\Paginator |
||
52 | */ |
||
53 | protected $paginator; |
||
54 | |||
55 | /** |
||
56 | * @var string |
||
57 | */ |
||
58 | protected $templateFile; |
||
59 | |||
60 | /** |
||
61 | * @var int |
||
62 | */ |
||
63 | protected $displayRelatedPages; |
||
64 | |||
65 | /** |
||
66 | * @var Localization\ITranslator |
||
67 | */ |
||
68 | protected $translator; |
||
69 | |||
70 | /** |
||
71 | * @var bool |
||
72 | */ |
||
73 | protected $useAjax = TRUE; |
||
74 | |||
75 | /** |
||
76 | * @param Localization\ITranslator $translator |
||
77 | */ |
||
78 | public function injectTranslator(Localization\ITranslator $translator = NULL) |
||
82 | |||
83 | /** |
||
84 | * @param NULL|string $templateFile |
||
85 | * @param Nette\ComponentModel\IContainer $parent |
||
86 | * @param null $name |
||
87 | */ |
||
88 | public function __construct( |
||
98 | |||
99 | /** |
||
100 | * Render control |
||
101 | */ |
||
102 | public function render() |
||
131 | |||
132 | /** |
||
133 | * @return $this |
||
134 | */ |
||
135 | public function enableAjax() |
||
141 | |||
142 | /** |
||
143 | * @return $this |
||
144 | */ |
||
145 | public function disableAjax() |
||
151 | |||
152 | /** |
||
153 | * @return Utils\Paginator |
||
154 | */ |
||
155 | public function getPaginator() |
||
164 | |||
165 | /** |
||
166 | * Change default control template path |
||
167 | * |
||
168 | * @param string $templateFile |
||
169 | * |
||
170 | * @return $this |
||
171 | * |
||
172 | * @throws Exceptions\FileNotFoundException |
||
173 | */ |
||
174 | public function setTemplateFile($templateFile) |
||
192 | |||
193 | /** |
||
194 | * @param Localization\ITranslator $translator |
||
195 | * |
||
196 | * @return $this |
||
197 | */ |
||
198 | public function setTranslator(Localization\ITranslator $translator) |
||
204 | |||
205 | /** |
||
206 | * @return Localization\ITranslator|null |
||
207 | */ |
||
208 | public function getTranslator() |
||
216 | |||
217 | /** |
||
218 | * @return array |
||
219 | */ |
||
220 | public function getSteps() |
||
248 | |||
249 | /** |
||
250 | * Loads state information |
||
251 | * |
||
252 | * @param array |
||
253 | * |
||
254 | * @return void |
||
255 | */ |
||
256 | public function loadState(array $params): void |
||
262 | |||
263 | /** |
||
264 | * @param int $page |
||
265 | */ |
||
266 | public function handleShowPage($page) |
||
270 | } |
||
271 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: