Skip to content

Conversation

tcoch
Copy link
Contributor

@tcoch tcoch commented Jul 10, 2025

Q A
Branch? 6.4
Bug fix? no
New feature? no
Deprecations? no
Issues #61022
License MIT

Suppose you have this route definition:

$route = new Route('/test/{foo}', ['foo' => 'foo-'], ['foo' => '\w+'], []);

With this route definition:

  • /test/foo works
  • /test/foo- fails, because the dash is not permitted by the requirement
  • /test works, thanks to the default value. However, the value of the parameter foo does not meet the requirement.

@nicolas-grekas
Copy link
Member

Thank you @tcoch.

@nicolas-grekas nicolas-grekas merged commit e5d6c57 into symfony:6.4 Jul 15, 2025
1 check was pending
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Jul 15, 2025
This PR was squashed before being merged into the 6.4 branch.

Discussion
----------

Add tip about default value

Related to symfony/symfony#61094

Commits
-------

5fd4e23 Add tip about default value
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.

3 participants