Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit65d100e

Browse files
Andrei Ignajaviereguiluz
Andrei Igna
authored andcommitted
[HttpFoundation] Add info for getAcceptableFormats() method
1 parent62b3c9f commit65d100e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎components/http_foundation.rst‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,21 @@ by using the following methods:
290290
:method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableContentTypes`
291291
Returns the list of accepted content types ordered by descending quality.
292292

293+
:method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableFormats`
294+
Returns the list of accepted client formats associated with the request.
295+
296+
Note that
297+
:method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableFormats`
298+
will use the data from
299+
:method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableContentTypes`
300+
and return the client acceptable formats::
301+
302+
$request->getAcceptableContentTypes();
303+
// returns ['text/html', 'application/xhtml+xml', 'application/xml', '*/*']
304+
305+
$request->getAcceptableFormats();
306+
// returns ['html', 'xml']
307+
293308
:method:`Symfony\\Component\\HttpFoundation\\Request::getLanguages`
294309
Returns the list of accepted languages ordered by descending quality.
295310

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp