From 4421eaa89976185b06617151b96d767a1358f4f5 Mon Sep 17 00:00:00 2001 From: DamienDeSousa Date: Thu, 3 Mar 2022 11:34:04 +0100 Subject: [PATCH] Add information to sub request --- components/http_kernel.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/http_kernel.rst b/components/http_kernel.rst index 5900a0c0b87..665ab507f67 100644 --- a/components/http_kernel.rst +++ b/components/http_kernel.rst @@ -711,6 +711,11 @@ look like this:: .. _http-kernel-resource-locator: +Also, note that by default, if the ``_format`` attribute is not set in your request, the value will be ``html``. +So, if your sub request returns something else than ``html`` (like json for instance) you can set it by setting the ``_format`` attribute on the request:: + + $request->attributes->set('_format', 'json'); + Locating Resources ------------------