Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0a0d913

Browse filesBrowse files
author
Amrouche Hamza
committed
[FrameworkBundle] [TwigBundle] Move the hinclude key from templating to fragments
1 parent 3568418 commit 0a0d913
Copy full SHA for 0a0d913

File tree

Expand file treeCollapse file tree

3 files changed

+10
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+10
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+2-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ private function registerFragmentsConfiguration(array $config, ContainerBuilder
488488
return;
489489
}
490490

491+
if (!$container->hasParameter('fragment.renderer.hinclude.global_template')) {
492+
$container->setParameter('fragment.renderer.hinclude.global_template', $config['hinclude_default_template']);
493+
}
494+
491495
$loader->load('fragment_listener.xml');
492496
$container->setParameter('fragment.path', $config['path']);
493497
}
@@ -905,7 +909,9 @@ private function registerTemplatingConfiguration(array $config, ContainerBuilder
905909
{
906910
$loader->load('templating.xml');
907911

908-
$container->setParameter('fragment.renderer.hinclude.global_template', $config['hinclude_default_template']);
912+
if (!$container->hasParameter('fragment.renderer.hinclude.global_template')) {
913+
$container->setParameter('fragment.renderer.hinclude.global_template', $config['hinclude_default_template']);
914+
}
909915

910916
if ($container->getParameter('kernel.debug')) {
911917
$logger = new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE);

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
+1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.