Twig Macros

Macros are to Twig what functions are to PHP. They help the developer reuse certain repeatable elements, and they give an additional clean and organized look to the final code. So here is a quick an easy Macro tutorial for Twig.

Aims of this tutorial :

  • Create a simple twig macro
  • Include it and use it in a template
  • Create a second macro that makes use of the first one

Read More