A
A
Alexander Vladimirovich2021-02-08 23:11:11
symfony
Alexander Vladimirovich, 2021-02-08 23:11:11

How to pass symfony response through some filter, process output?

Greetings!
Everything that symfony outputs to the browser must be passed through some kind of processing. For example, replace external links with away?to=... and more.
How to do this with regular symfony or twig tools or in some other way, it is desirable that the result be cached.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Zemlyanoy, 2021-02-08
@polyanin

Through events. Intercept the response event, change what you need, return a new Response object

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question