Skip to content

Commit f53edb0

Browse files
author
Amrouche Hamza
committed
[FrameworkBundle] [TwigBundle] Move the hinclude key from templating to fragments
1 parent f587944 commit f53edb0

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ private function addFragmentsSection(ArrayNodeDefinition $rootNode)
191191
->info('fragments configuration')
192192
->canBeEnabled()
193193
->children()
194+
->scalarNode('hinclude_default_template')->defaultNull()->end()
194195
->scalarNode('path')->defaultValue('/_fragment')->end()
195196
->end()
196197
->end()
@@ -610,7 +611,7 @@ private function addTemplatingSection(ArrayNodeDefinition $rootNode)
610611
->then(function () { return ['enabled' => false, 'engines' => false]; })
611612
->end()
612613
->children()
613-
->scalarNode('hinclude_default_template')->defaultNull()->end()
614+
->scalarNode('hinclude_default_template')->setDeprecated('Using the key "hinclude_default_template" in the templating is deprecated since Symfony 4.3. Use the config key under fragments instead.')->defaultNull()->end()
614615
->scalarNode('cache')->end()
615616
->arrayNode('form')
616617
->addDefaultsIfNotSet()

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ private function registerFragmentsConfiguration(array $config, ContainerBuilder
487487

488488
return;
489489
}
490+
$container->setParameter('fragment.renderer.hinclude.global_template', $config['hinclude_default_template']);
490491

491492
$loader->load('fragment_listener.xml');
492493
$container->setParameter('fragment.path', $config['path']);

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ protected static function getBundleDefaultConfig()
209209
'fragments' => [
210210
'enabled' => false,
211211
'path' => '/_fragment',
212+
'hinclude_default_template' => null,
212213
],
213214
'profiler' => [
214215
'enabled' => false,

0 commit comments

Comments
 (0)