public function register(SilexApp $app) {
        $app['twig'] = $app->share($app->extend('twig', function (\Twig_Environment $twig, SilexApp $app) {
            $class = $this->getServiceConfig()->getProviderClass();
            $twig->addExtension(new $class);

            return $twig;
        }));
    }
public function register(SilexApp $app) {
        $app['twig'] = $app->share($app->extend('twig', function (\Twig_Environment $twig, SilexApp $app) {
            $class = $this->getServiceConfig()->getProviderClass();
            $twig->addExtension(new $class);

            return $twig;
        }));
    }
public function register ( SilexApp $ app ) { $ app [ 'twig' ] = $ app -> share ( $ app -> extend ( 'twig' , function ( \ Twig_Environment $ twig , SilexApp $ app ) { $ class = $ this -> getServiceConfig ( ) -> getProviderClass ( ) ; $ twig -> addExtension ( new $ class ) ; return $ twig ; } ) ) ; }
Extend Twig Environment with provided Extension.

@param SilexApp $app

@return void
Extend Twig Environment with provided Extension .