Skip to content

[Routing] Document the Requirement constants in routing.rst #16926

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

Merged
merged 1 commit into from
Jul 4, 2022
Merged

[Routing] Document the Requirement constants in routing.rst #16926

merged 1 commit into from
Jul 4, 2022

Conversation

nicwortel
Copy link
Contributor

Fixes #16718

symfony/symfony#45528 by @fancyweb introduced the Symfony\Component\Routing\Requirement\Requirement enum in Symfony 6.1, as a solution for symfony/symfony#26524.

It was blogged about in https://symfony.com/blog/new-in-symfony-6-1-improved-routing-requirements-and-utf-8-parameters, but I couldn't find it anywhere in the Routing documentation.

This PR adds a small hint about the use of the Requirement enum for common route requirements:

The Requirement enum contains a collection of commonly used regular-expression constants such as digits, dates and UUIDs which can be used as route parameter requirements.

I'm open for suggestions to further improve this. I decided to use a small info block instead without code examples, because it doesn't seem to be a big feature and I'm not sure how well it is supported across all configuration formats. Let me know if you would like to see some code examples.

@nicwortel nicwortel changed the title Document the Requirement constants in routing.rst [Routing] Document the Requirement constants in routing.rst Jun 29, 2022
@carsonbot carsonbot changed the title [Routing] Document the Requirement constants in routing.rst Document the Requirement constants in routing.rst Jun 30, 2022
@xabbuh xabbuh added this to the 6.1 milestone Jul 1, 2022
@carsonbot carsonbot changed the title Document the Requirement constants in routing.rst [Routing] Document the Requirement constants in routing.rst Jul 4, 2022
@javiereguiluz javiereguiluz merged commit 2baf371 into symfony:6.1 Jul 4, 2022
@javiereguiluz
Copy link
Member

Nic, thanks for your contribution and for the perfect explanation (which even includes a screenshot of the resulting rendering 😍).

While merging we did a minor tweak to add the versionadded directive which we include for new features. See 5b31381

Thanks!

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.

5 participants