1 | <?php |
||
16 | class SeoExtension extends \Twig_Extension |
||
17 | { |
||
18 | /** |
||
19 | * @var SeoPageInterface |
||
20 | */ |
||
21 | protected $page; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $encoding; |
||
27 | |||
28 | /** |
||
29 | * @param SeoPageInterface $page |
||
30 | * @param string $encoding |
||
31 | */ |
||
32 | public function __construct(SeoPageInterface $page, $encoding) |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | public function getFunctions() |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function getName() |
||
62 | |||
63 | /** |
||
64 | * NEXT_MAJOR: remove this method. |
||
65 | * |
||
66 | * @deprecated since 2.0, to be removed in 3.0 |
||
67 | */ |
||
68 | public function renderTitle() |
||
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getTitle() |
||
86 | |||
87 | /** |
||
88 | * NEXT_MAJOR: remove this method. |
||
89 | * |
||
90 | * @deprecated since 2.0, to be removed in 3.0 |
||
91 | */ |
||
92 | public function renderMetadatas() |
||
102 | |||
103 | /** |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getMetadatas() |
||
130 | |||
131 | /** |
||
132 | * NEXT_MAJOR: remove this method. |
||
133 | * |
||
134 | * @deprecated since 2.0, to be removed in 3.0 |
||
135 | */ |
||
136 | public function renderHtmlAttributes() |
||
146 | |||
147 | /** |
||
148 | * @return string |
||
149 | */ |
||
150 | public function getHtmlAttributes() |
||
159 | |||
160 | /** |
||
161 | * NEXT_MAJOR: remove this method. |
||
162 | * |
||
163 | * @deprecated since 2.0, to be removed in 3.0 |
||
164 | */ |
||
165 | public function renderHeadAttributes() |
||
175 | |||
176 | /** |
||
177 | * @return string |
||
178 | */ |
||
179 | public function getHeadAttributes() |
||
188 | |||
189 | /** |
||
190 | * NEXT_MAJOR: remove this method. |
||
191 | * |
||
192 | * @deprecated since 2.0, to be removed in 3.0 |
||
193 | */ |
||
194 | public function renderLinkCanonical() |
||
204 | |||
205 | /** |
||
206 | * @return string |
||
207 | */ |
||
208 | public function getLinkCanonical() |
||
214 | |||
215 | /** |
||
216 | * NEXT_MAJOR: remove this method. |
||
217 | * |
||
218 | * @deprecated since 2.0, to be removed in 3.0 |
||
219 | */ |
||
220 | public function renderLangAlternates() |
||
230 | |||
231 | /** |
||
232 | * @return string |
||
233 | */ |
||
234 | public function getLangAlternates() |
||
243 | |||
244 | /** |
||
245 | * @return string |
||
246 | */ |
||
247 | public function getOembedLinks() |
||
256 | |||
257 | /** |
||
258 | * Creates a script tag with type 'json-ld' and the JSON-LD string stored in page object. |
||
259 | * |
||
260 | * @return string |
||
261 | */ |
||
262 | public function getStructuredData() |
||
270 | |||
271 | /** |
||
272 | * @param string $string |
||
273 | * |
||
274 | * @return mixed |
||
275 | */ |
||
276 | private function normalize($string) |
||
280 | } |
||
281 |
If you suppress an error, we recommend checking for the error condition explicitly: