Skip to content

Commit 0d8035b

Browse files
committed
minor #11303 added requirements for {_format} (stoccc)
This PR was merged into the 3.4 branch. Discussion ---------- added requirements for {_format} I added requirements for the `{_format}` parameter: in this example `_format` should be `xml` or `html` <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- f2ebfed added requirements for {_format}
2 parents 82318cc + f2ebfed commit 0d8035b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templating/formats.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ be configured so that ``/about-us`` sets the request format to ``html`` while
5151
special ``_format`` placeholder in your route definition::
5252

5353
/**
54-
* @Route("/{slug}.{_format}", defaults={"_format"="html"})
54+
* @Route("/{slug}.{_format}", defaults={"_format"="html"}, requirements={"_format"="html|xml"}))
5555
*/
5656
public function showAction(Request $request, $slug)
5757
{

0 commit comments

Comments
 (0)