I know Twig has a {% spaceless %} filter, but it only removes spaces between html tags.
I need to return a single line of html for every page in the site. I have a regexp that can deal with that, but I don't know where to use it in sf2, since everything happens automagically.
I think I have to register a new templating engine, or add a twig extension, but I couldn't find enough documentation about the subject, so I'm stuck
Any ideas?
To run your regex on all view output, you can hook into the
kernel.responseevent that is dispatched by the Symfony2 framework.From the section on kernel.response:
I would recommend reading the Internals chapter for even more details.