You can also use filters to execute code after execution:
class myFilter extends sfFilter { public function execute($filterChain) {
This is because full execution in Symfony is one big "filter chain" ... If you look closely at your filters.yml
, you will see that the rendering
filter is called first, then the security
filter, the cache
filter, and finally execution
filter. The execution filter is the filter that actually executes the request (invokes the controller and that's it).
To illustrate this: the cache filter, before descending the chain, checks to see if a valid output in the cache is available, and return it. If he now executes the next filter in the chain, and when he returns, save the output so that subsequent requests can use the cache.
source share