Created
October 11, 2011 18:52
-
-
Save peschee/1279027 to your computer and use it in GitHub Desktop.
Add your own Twig extensions in Silex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// additional twig extensions | |
$oldTwigConfiguration = isset($app['twig.configure']) ? $app['twig.configure']: function(){}; | |
$app['twig.configure'] = $app->protect(function($twig) use ($oldTwigConfiguration) { | |
$oldTwigConfiguration($twig); | |
$twig->addExtension(new Some\Twig\Extension()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment