diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
index f38a6dd638..4c153f0629 100644
--- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
@@ -320,6 +320,10 @@ class Configuration implements ConfigurationInterface
->arrayNode('templating')
->info('templating configuration')
->canBeEnabled()
+ ->beforeNormalization()
+ ->ifTrue(function ($v) { return false === $v || is_array($v) && false === $v['enabled']; })
+ ->then(function () { return array('enabled' => false, 'engines' => false); })
+ ->end()
->children()
->scalarNode('hinclude_default_template')->defaultNull()->end()
->scalarNode('cache')->end()
@@ -346,8 +350,9 @@ class Configuration implements ConfigurationInterface
->example(array('twig'))
->isRequired()
->requiresAtLeastOneElement()
+ ->canBeUnset()
->beforeNormalization()
- ->ifTrue(function ($v) { return !is_array($v); })
+ ->ifTrue(function ($v) { return !is_array($v) && false !== $v; })
->then(function ($v) { return array($v); })
->end()
->prototype('scalar')->end()
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
index 830702213f..4a20f68756 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
@@ -147,10 +147,11 @@
-
+
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_disabled.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_disabled.php
new file mode 100644
index 0000000000..f76d8ad351
--- /dev/null
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/templating_disabled.php
@@ -0,0 +1,5 @@
+loadFromExtension('framework', array(
+ 'templating' => false,
+));
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/templating_disabled.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/templating_disabled.xml
new file mode 100644
index 0000000000..1078976462
--- /dev/null
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/templating_disabled.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/templating_disabled.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/templating_disabled.yml
new file mode 100644
index 0000000000..1e548b8594
--- /dev/null
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/templating_disabled.yml
@@ -0,0 +1,2 @@
+framework:
+ templating: false
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
index ef0c5522fd..a03235c1dd 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
@@ -208,6 +208,13 @@ abstract class FrameworkExtensionTest extends TestCase
$this->assertEquals('global_hinclude_template', $container->getParameter('fragment.renderer.hinclude.global_template'), '->registerTemplatingConfiguration() registers the global hinclude.js template');
}
+ public function testTemplatingCanBeDisabled()
+ {
+ $container = $this->createContainerFromFile('templating_disabled');
+
+ $this->assertFalse($container->hasParameter('templating.engines'), '"templating.engines" container parameter is not registered when templating is disabled.');
+ }
+
public function testAssets()
{
$container = $this->createContainerFromFile('assets');