diff --git a/templates.rst b/templates.rst
index b6ae333cee1..d1c714d4225 100644
--- a/templates.rst
+++ b/templates.rst
@@ -705,6 +705,11 @@ provided by Symfony:
site_name: 'ACME'
theme: 'dark'
+ # optionally you can define HTTP headers to add to the response
+ headers:
+ Content-Type: 'text/html'
+ foo: 'bar'
+
.. code-block:: xml
@@ -734,6 +739,11 @@ provided by Symfony:
ACME
dark
+
+
+
+ text/html
+
@@ -764,11 +774,20 @@ provided by Symfony:
'context' => [
'site_name' => 'ACME',
'theme' => 'dark',
+ ],
+
+ // optionally you can define HTTP headers to add to the response
+ 'headers' => [
+ 'Content-Type' => 'text/html',
]
])
;
};
+.. versionadded:: 7.2
+
+ The ``headers`` option was introduced in Symfony 7.2.
+
Checking if a Template Exists
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~