Skip to content

Commit

Permalink
Update ViolinistMessages.php
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm authored Jul 17, 2024
1 parent f08e463 commit a14e02a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ViolinistMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ class ViolinistMessages
*/
public function __construct()
{
$loader = new \Twig_Loader_Filesystem(__DIR__ . '/../templates');
$this->twig = new \Twig_Environment($loader);
if (!class_exists('\Twig\Loader\FilesystemLoader')) {
$loader = new \Twig_Loader_Filesystem(__DIR__ . '/../templates');
$this->twig = new \Twig_Environment($loader);
} else {
// twig 3.
$loader = new \Twig\Loader\FilesystemLoader('/path/to/templates');
$this>twig = new \Twig\Environment($loader, []);
}
}

/**
Expand Down

0 comments on commit a14e02a

Please sign in to comment.