Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f2ebfed

Browse filesBrowse 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
Copy full SHA for f2ebfed

File tree

1 file changed

+1
-1
lines changed
Filter options

1 file changed

+1
-1
lines changed

‎templating/formats.rst

Copy file name to clipboardExpand all lines: templating/formats.rst
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.