Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 middleware

I'm looking for a way to create a Django-like middleware for an application on Symfony2. Basically, I need to preprocess every request before it comes to Controllers and postprocess every response after Controllers, but before it comes to user.

Any thoughts?

like image 473
gakhov Avatar asked Jun 30 '12 15:06

gakhov


1 Answers

You don't need a middle ware for this in Symfony2. There are things called Kernel Events.

http://symfony.com/doc/current/book/internals.html#events

You may want to have a look at kernel.request and kernel.response

like image 135
Martin Holzhauer Avatar answered Nov 06 '22 14:11

Martin Holzhauer