annotate src/Kachkaev/JstmplBundle/DependencyInjection/JstmplExtension.php @ 1:f38015048f48 tip

Added GPL
author Daniel Wolff
date Sat, 13 Feb 2016 20:43:38 +0100
parents 493bcb69166c
children
rev   line source
Daniel@0 1 <?php
Daniel@0 2
Daniel@0 3 namespace Kachkaev\JstmplBundle\DependencyInjection;
Daniel@0 4
Daniel@0 5 use Symfony\Component\DependencyInjection\ContainerBuilder;
Daniel@0 6 use Symfony\Component\Config\FileLocator;
Daniel@0 7 use Symfony\Component\HttpKernel\DependencyInjection\Extension;
Daniel@0 8 use Symfony\Component\DependencyInjection\Loader;
Daniel@0 9
Daniel@0 10 class JstmplExtension extends Extension
Daniel@0 11 {
Daniel@0 12 public function load(array $configs, ContainerBuilder $container)
Daniel@0 13 {
Daniel@0 14 $configuration = new Configuration();
Daniel@0 15 $config = $this->processConfiguration($configuration, $configs);
Daniel@0 16
Daniel@0 17 $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
Daniel@0 18 $loader->load('jstmpl.xml');
Daniel@0 19 $loader->load('templating_twig.xml');
Daniel@0 20
Daniel@0 21 $container->setParameter('jstmpl.source.patterns', $config['source']['patterns']);
Daniel@0 22 }
Daniel@0 23 }