Skip to content

Commit

Permalink
minor symfony#11303 added requirements for {_format} (stoccc)
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
wouterj committed Apr 6, 2019
2 parents 82318cc + f2ebfed commit 0d8035b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templating/formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ be configured so that ``/about-us`` sets the request format to ``html`` while
special ``_format`` placeholder in your route definition::

/**
* @Route("/{slug}.{_format}", defaults={"_format"="html"})
* @Route("/{slug}.{_format}", defaults={"_format"="html"}, requirements={"_format"="html|xml"}))
*/
public function showAction(Request $request, $slug)
{
Expand Down

0 comments on commit 0d8035b

Please sign in to comment.