Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Use registerTwigExtension()
Browse files Browse the repository at this point in the history
Fixes a bug where the plugin may cause Twig to be loaded before it should be, and another bug where the extension might not be available if the Template Mode ever changes from CP to Site, or vise-versa.
  • Loading branch information
brandonkelly authored Jul 20, 2018
1 parent 49c13bc commit 6a2f346
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Collections.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function init()
parent::init();
self::$plugin = $this;

Craft::$app->view->twig->addExtension(new CollectionsTwigExtension());
Craft::$app->view->registerTwigExtension(new CollectionsTwigExtension());

Event::on(
CraftVariable::class,
Expand Down

0 comments on commit 6a2f346

Please sign in to comment.