Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced old way of specifying http method by the new one #4131

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions cookbook/routing/redirect_trailing_slash.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ system, as explained below:
defaults: { _controller: AcmeDemoBundle:Redirecting:removeTrailingSlash }
requirements:
url: .*/$
_method: GET
methods: [GET]

.. code-block:: xml

Expand All @@ -53,7 +53,7 @@ system, as explained below:
<route id="remove_trailing_slash" path="/{url}">
<default key="_controller">AcmeDemoBundle:Redirecting:removeTrailingSlash</default>
<requirement key="url">.*/$</requirement>
<requirement key="_method">GET</requirement>
<method>GET</method>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no method element. In XML, you have to use the methods attribute instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it would look like: <route methods="GET">...</route>? I was not sure about the xml version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, you can see an example as a reference here.

</route>
</routes>

Expand All @@ -72,8 +72,11 @@ system, as explained below:
),
array(
'url' => '.*/$',
'_method' => 'GET',
)
),
array(),
'',
array(),
array('GET')
)
);

Expand Down