@@ -218,21 +218,23 @@ Accessing `Accept-*` Headers Data
218
218
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
219
219
220
220
You can easily access basic data extracted from ``Accept-* `` headers
221
- by using following methods:
221
+ by using the following methods:
222
222
223
223
* :method: `Symfony\\ Component\\ HttpFoundation\\ Request::getAcceptableContentTypes `:
224
- Returns the list of accepted content types ordered by descending quality;
224
+ returns the list of accepted content types ordered by descending quality;
225
225
226
226
* :method: `Symfony\\ Component\\ HttpFoundation\\ Request::getLanguages `:
227
- Returns the list of accepted languages ordered by descending quality;
227
+ returns the list of accepted languages ordered by descending quality;
228
228
229
229
* :method: `Symfony\\ Component\\ HttpFoundation\\ Request::getCharsets `:
230
- Returns the list of accepted languages ordered by descending quality;
230
+ returns the list of accepted languages ordered by descending quality;
231
231
232
- If you need to egt full access to parsed data from ``Accept ``, ``Accept-Language ``,
232
+ If you need to get full access to parsed data from ``Accept ``, ``Accept-Language ``,
233
233
``Accept-Charset `` or ``Accept-Encoding ``, you can use
234
234
:class: `Symfony\\ Component\\ HttpFoundation\\ AcceptHeader ` utility class::
235
235
236
+ use Symfony\Component\HttpFoundation\AcceptHeader;
237
+
236
238
$accept = AcceptHeader::fromString($request->headers->get('Accept'));
237
239
if ($accept->has('text/html') {
238
240
$item = $accept->get('html');
0 commit comments