Skip to content

Commit

Permalink
Fix for issue #14, in order for already initialized class to be loade…
Browse files Browse the repository at this point in the history
…d as an Twig extension.
  • Loading branch information
silentworks committed Apr 27, 2012
1 parent ceeea7a commit b827dc2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Views/TwigView.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ public function getEnvironment() {
Twig_Extensions_Autoloader::register();

foreach (self::$twigExtensions as $ext) {
$this->twigEnvironment->addExtension(new $ext);
$extension = is_object($ext) ? $ext : new $ext;
$this->twigEnvironment->addExtension($extension);
}
}
}
Expand Down

0 comments on commit b827dc2

Please sign in to comment.