From 8fb8b5acdcc8f7ffc983e9f03274ee2f8e23c88a Mon Sep 17 00:00:00 2001 From: Ahmet Date: Thu, 26 Sep 2019 11:22:35 +0300 Subject: [PATCH] Configuration Bug Solved --- DependencyInjection/AhcTwigSeoExtension.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/DependencyInjection/AhcTwigSeoExtension.php b/DependencyInjection/AhcTwigSeoExtension.php index b11bb43..c655164 100644 --- a/DependencyInjection/AhcTwigSeoExtension.php +++ b/DependencyInjection/AhcTwigSeoExtension.php @@ -6,9 +6,11 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; +use Symfony\Component\Yaml\Yaml; -class AhcTwigSeoExtension extends Extension +class AhcTwigSeoExtension extends Extension implements PrependExtensionInterface { public function load(array $configs, ContainerBuilder $container) { @@ -16,8 +18,14 @@ public function load(array $configs, ContainerBuilder $container) $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yaml'); - $loader->load('ahc_twig_seo.yaml'); $container->setParameter('ahc_twig_seo_config', $config); } + + public function prepend(ContainerBuilder $container) + { + $config = Yaml::parseFile(__DIR__.'/../Resources/config/ahc_twig_seo.yaml'); + + $container->prependExtensionConfig('ahc_twig_seo', $config['ahc_twig_seo']); + } } \ No newline at end of file