protected function getExtensions()
{
// should be moved to the Form component once absolute file paths are supported
// by the default name parser in the Templating component
$reflClass = new \ReflectionClass('Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle');
$root = realpath(dirname($reflClass->getFileName()) . '/Resources/views');
$rootTheme = realpath(__DIR__ . '/Resources');
$templateNameParser = new StubTemplateNameParser($root, $rootTheme);
$loader = new FilesystemLoader(array());
$this->engine = new PhpEngine($templateNameParser, $loader);
$this->engine->addGlobal('global', '');
$this->engine->setHelpers(array(new TranslatorHelper(new StubTranslator())));
return array_merge(parent::getExtensions(), array(new TemplatingExtension($this->engine, $this->csrfTokenManager, array('FrameworkBundle:Form'))));
}