symfony / symfony-docs

The Symfony documentation
https://symfony.com/doc
Other
2.18k stars 5.13k forks source link

[Routing] Add example of Requirement enum #20409

Closed alamirault closed 2 days ago

alamirault commented 5 days ago

Requirement Enum values are not cases but constants.

So in YAML routing format we must use !php/const instead of !php/enum.

This PR add examples to how to use the "Requirement enum"

Can you confirm constants are not supported in XML format for routing ? (if not, maybe we can make PR like https://github.com/symfony/symfony/pull/58035 cc @alexandre-daubois)

javiereguiluz commented 2 days ago

Yes, this is a bit confusing. But your example will make things much more clear. Thanks Antoine!