Skip to content

Commit f2ebfed

Browse files
authored
added requirements for {_format}
I added requirements for {_format}: in this example `_format` should be `xml` or `html`
1 parent bcfa1e4 commit f2ebfed

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)