Skip to content

Commit

Permalink
Merge pull request #2 from ahmetcelikezer/1.0.1
Browse files Browse the repository at this point in the history
Configuration Bug Solved
  • Loading branch information
ahmetcelikezer committed Sep 26, 2019
2 parents 6bde0b3 + 8fb8b5a commit 38cd30d
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 38cd30d

Please sign in to comment.