Creating Custom Twig Functions and Filters
Now that the demo website is fully styled, we can move on to some more advanced topics. The first one is the ability to extend Twig with custom functions and filters.
Twig is baked with a highly extensible framework that allows us to do customizations to simplify our templates by delegating the complex logic away from the theme layer.
In this chapter, we’re going to cover the following main topics:
- Creating a custom Twig function
- Creating a custom Twig filter