Skip to content

Commit

Permalink
Configuration Bug Solved
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmet committed Sep 26, 2019
1 parent 6bde0b3 commit 8fb8b5a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions DependencyInjection/AhcTwigSeoExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,26 @@
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)
{
$config = $this->processConfiguration(new Configuration(), $configs);

$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']);
}
}

0 comments on commit 8fb8b5a

Please sign in to comment.