How can I add a custom filter to my Twig templates inside of Slim 3?

{{ 'bruce banner'|angry }} Gotta love a good filter.  Documentation on how to add filters to Twig in Slim 3 is sparse at the moment, and it’s changed from Slim 2.   You can actually do it in one line: $view-getEnvironment()-addFilter($filter); But...

We do not write or claim ownership of any of the articles featured on this website. Instead we aim to highlight them so you can read the full article at the original source. To finish reading this article, follow the continue reading link below. CONTINUE READING
Author: Michael Phillips

Michael Phillips is a self appointed code ninja from Brisbane, Australia - Good'ay mate!

Sign up to our newsletter

Don't worry, we won't give your email to any third parties
and you can unsubscribe at any time.