File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -705,6 +705,11 @@ provided by Symfony:
705
705
site_name : ' ACME'
706
706
theme : ' dark'
707
707
708
+ # optionally you can define HTTP headers to add to the response
709
+ headers :
710
+ Content-Type : ' text/html'
711
+ foo : ' bar'
712
+
708
713
.. code-block :: xml
709
714
710
715
<!-- config/routes.xml -->
@@ -734,6 +739,11 @@ provided by Symfony:
734
739
<default key =" site_name" >ACME</default >
735
740
<default key =" theme" >dark</default >
736
741
</default >
742
+
743
+ <!-- optionally you can define HTTP headers to add to the response -->
744
+ <default key =" headers" >
745
+ <default key =" Content-Type" >text/html</default >
746
+ </default >
737
747
</route >
738
748
</routes >
739
749
@@ -764,11 +774,20 @@ provided by Symfony:
764
774
'context' => [
765
775
'site_name' => 'ACME',
766
776
'theme' => 'dark',
777
+ ],
778
+
779
+ // optionally you can define HTTP headers to add to the response
780
+ 'headers' => [
781
+ 'Content-Type' => 'text/html',
767
782
]
768
783
])
769
784
;
770
785
};
771
786
787
+ .. versionadded :: 7.2
788
+
789
+ The ``headers `` option was introduced in Symfony 7.2.
790
+
772
791
Checking if a Template Exists
773
792
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
774
793
You can’t perform that action at this time.
0 commit comments