Skip to main content
4 votes

How to create Twig extension in Craft CMS 5

There's a page in the docs you might have missed that covers this here: https://craftcms.com/docs/5.x/extend/extending-twig.html So specifically, you want to bind the EVENT_INIT event of the Craft ...
James Smith's user avatar
  • 5,344
2 votes

How to create Twig extension in Craft CMS 5

If you started this project with a Craft 5, you have access to Generator, which can scaffold a Twig extension for you! In the project directory, run: php craft make module # ... php craft make twig-...
August Miller's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible