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 723d9b3

Browse filesBrowse files
committed
add @wouterj catches
1 parent ee0fb1a commit 723d9b3
Copy full SHA for 723d9b3

File tree

Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-7
lines changed

‎cookbook/event_dispatcher/before_after_filters.rst

Copy file name to clipboardExpand all lines: cookbook/event_dispatcher/before_after_filters.rst
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ hash (with a salt using that token) to all our responses.
3838

3939
So, after generating a JSON response, this hash has to be added to the response.
4040

41-
Before and after filters with kernel.controller / kernel.response events
42-
------------------------------------------------------------------------
41+
Before and after filters with ``kernel.controller`` / ``kernel.response`` events
42+
--------------------------------------------------------------------------------
4343

4444
Basic Setup
4545
~~~~~~~~~~~
@@ -86,24 +86,24 @@ request needs token validation. Regarding the response, you will also need
8686
some way to identify that the response needs to be hashed.
8787

8888
A clean and easy way is to create an empty interface and make the controllers
89-
implement it:
89+
implement it::
9090

9191
namespace Acme\DemoBundle\Controller;
9292

9393
interface TokenAuthenticatedController
9494
{
95-
// Nothing here
95+
// ...
9696
}
9797

98-
And also create a HashedResponse object extending Response
98+
And also create a ``HashedResponse`` object extending ``Response``
9999

100100
namespace Acme\DemoBundle\Response;
101101

102102
use Symfony\Component\HttpFoundation\Response;
103103

104104
class HashedResponse extends Response
105105
{
106-
// Nothing here
106+
// ...
107107
}
108108

109109
A controller that implements this interface simply looks like this::
@@ -172,7 +172,7 @@ event listeners, you can learn more about them at :doc:`/cookbook/service_contai
172172
if ($response instanceof HashedResponse) {
173173
$token = $event->getRequest()->get('token');
174174

175-
$hash = sha1($response->getContent() . $token);
175+
$hash = sha1($response->getContent().$token);
176176

177177
$response->setContent(
178178
json_encode(array(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.