From 1fd91db639fb1c4a4bd1fc80635773dddfb4792f Mon Sep 17 00:00:00 2001 From: Andrei Igna Date: Thu, 7 Jun 2018 18:18:08 +0200 Subject: [PATCH 1/2] [HttpFoundation] Add info for getAcceptableFormats() method --- components/http_foundation.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/http_foundation.rst b/components/http_foundation.rst index d3f3df90781..8acfa64f16f 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -290,6 +290,9 @@ by using the following methods: :method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableContentTypes` Returns the list of accepted content types ordered by descending quality. +:method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableFormats` + Returns the list of accepted client formats associated with the request. + :method:`Symfony\\Component\\HttpFoundation\\Request::getLanguages` Returns the list of accepted languages ordered by descending quality. From 8140b80c49c149989d78109a420ffa7c0469b04c Mon Sep 17 00:00:00 2001 From: Andrei Igna Date: Sat, 9 Jun 2018 16:44:04 +0200 Subject: [PATCH 2/2] [HttpFoundation] Adds more info about getAcceptableFormats method --- components/http_foundation.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 8acfa64f16f..d40eff97eba 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -293,6 +293,18 @@ by using the following methods: :method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableFormats` Returns the list of accepted client formats associated with the request. +Note that +:method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableFormats` +will use the data from +:method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableContentTypes` +and return the client acceptable formats:: + + $request->getAcceptableContentTypes(); + // returns ['text/html', 'application/xhtml+xml', 'application/xml', '*/*'] + + $request->getAcceptableFormats(); + // returns ['html', 'xml'] + :method:`Symfony\\Component\\HttpFoundation\\Request::getLanguages` Returns the list of accepted languages ordered by descending quality.