Skip to content

Conversation

Timherlaud
Copy link
Contributor

@Timherlaud Timherlaud commented May 22, 2024

fixes #19909

@carsonbot carsonbot added this to the 7.2 milestone May 22, 2024
@Timherlaud Timherlaud force-pushed the patch-2 branch 2 times, most recently from 907fd69 to e33c2f6 Compare May 22, 2024 14:55
Copy link
Contributor

@alamirault alamirault left a 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
Comment on lines 708 to 711
# add headers in response
headers:
Content-Type: 'image/svg+xml'
foo: 'bar'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 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'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

.. code-block:: xml
<!-- config/routes.xml -->
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done :)

.. code-block:: xml
<!-- config/routes.xml -->
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good information 👍

@Timherlaud
Copy link
Contributor Author

@alamirault thanks for your help, very good work, happy to see how to do a good PR

@OskarStark
Copy link
Contributor

Thank you Tim.

@OskarStark OskarStark merged commit 84c3c45 into symfony:7.2 May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants