-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[FrameworkBundle] Add support for setting headers with TemplateContoller
#19911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
907fd69
to
e33c2f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution.
I left some comments
(I didn't see your PR before do it one my side 🙈 , you can take inspiration of mine 7.1...alamirault:symfony-docs:feature/19909-headers-template-controller)
templates.rst
Outdated
# add headers in response | ||
headers: | ||
Content-Type: 'image/svg+xml' | ||
foo: 'bar' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# add headers in response | |
headers: | |
Content-Type: 'image/svg+xml' | |
foo: 'bar' | |
# optionally you can define HTTP headers to add to the response | |
headers: | |
Content-Type: 'text/html' | |
foo: 'bar' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
headers: | ||
Content-Type: 'image/svg+xml' | ||
foo: 'bar' | ||
|
||
.. code-block:: xml | ||
|
||
<!-- config/routes.xml --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also update xml and php examples ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done :)
headers: | ||
Content-Type: 'image/svg+xml' | ||
foo: 'bar' | ||
|
||
.. code-block:: xml | ||
|
||
<!-- config/routes.xml --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Foreach new feature, we add directive versionadded
to tell is new. You can add it above Checking if a Template Exists
title
.. versionadded:: 7.2
The ``headers`` option was introduced in Symfony 7.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good information 👍
@alamirault thanks for your help, very good work, happy to see how to do a good PR |
Thank you Tim. |
fixes #19909