1 | <?php |
||
19 | abstract class AbstractLinkViewHelper extends AbstractTagBasedViewHelper |
||
20 | { |
||
21 | /** |
||
22 | * Tag type. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $tagName = 'a'; |
||
27 | |||
28 | /** |
||
29 | * Store the last href to avoid escaping for the URI view Helper. |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $lastHref = ''; |
||
34 | |||
35 | /** |
||
36 | * @var LoggerInterface |
||
37 | */ |
||
38 | protected $logger; |
||
39 | |||
40 | /** |
||
41 | * Build up the object |
||
42 | */ |
||
43 | public function __construct() |
||
48 | |||
49 | /** |
||
50 | * Arguments initialization. |
||
51 | */ |
||
52 | public function initializeArguments() |
||
63 | |||
64 | /** |
||
65 | * render the link. |
||
66 | * |
||
67 | * @param int|null $pageUid target page. See TypoLink destination |
||
68 | * @param array $additionalParams query parameters to be attached to the resulting URI |
||
69 | * @param bool $absolute |
||
70 | * |
||
71 | * @return string Rendered page URI |
||
72 | */ |
||
73 | public function renderLink($pageUid = null, array $additionalParams = [], $absolute = false) |
||
91 | |||
92 | /** |
||
93 | * Get the right page Uid. |
||
94 | * |
||
95 | * @param int $pageUid |
||
96 | * @param string|null $contextName |
||
97 | * |
||
98 | * @return int |
||
99 | */ |
||
100 | protected function getPageUid($pageUid, $contextName = null) |
||
116 | } |
||
117 |
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: