예제 #1
0
 /**
  * Customizes the Container instance.
  *
  * @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
  *
  * @return \Symfony\Components\DependencyInjection\ContainerBuilder A ContainerBuilder instance
  */
 public function buildContainer(ParameterBagInterface $parameterBag)
 {
     ContainerBuilder::registerExtension(new WebExtension($parameterBag->get('kernel.bundle_dirs'), $parameterBag->get('kernel.bundles')));
     $dirs = array('%kernel.root_dir%/views/%%bundle%%/%%controller%%/%%name%%%%format%%.%%renderer%%');
     foreach ($parameterBag->get('kernel.bundle_dirs') as $dir) {
         $dirs[] = $dir . '/%%bundle%%/Resources/views/%%controller%%/%%name%%%%format%%.%%renderer%%';
     }
     $parameterBag->set('templating.loader.filesystem.path', $dirs);
     $container = new ContainerBuilder();
     if ($parameterBag->get('kernel.debug')) {
         $loader = new XmlFileLoader($container, __DIR__ . '/Resources/config');
         $loader->load('debug.xml');
     }
     return $container;
 }
예제 #2
0
 /**
  * Customizes the Container instance.
  *
  * @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
  *
  * @return \Symfony\Components\DependencyInjection\ContainerBuilder A ContainerBuilder instance
  */
 public function buildContainer(ParameterBagInterface $parameterBag)
 {
     ContainerBuilder::registerExtension(new KernelExtension());
     $container = new ContainerBuilder();
     $loader = new XmlFileLoader($container, array(__DIR__ . '/../Resources/config', __DIR__ . '/Resources/config'));
     $loader->load('services.xml');
     if ($parameterBag->get('kernel.debug')) {
         $loader->load('debug.xml');
         $container->setDefinition('event_dispatcher', $container->findDefinition('debug.event_dispatcher'));
     }
     return $container;
 }
예제 #3
0
 /**
  * Customizes the Container instance.
  *
  * @param \Symfony\Components\DependencyInjection\ParameterBag\ParameterBagInterface $parameterBag A ParameterBagInterface instance
  *
  * @return \Symfony\Components\DependencyInjection\ContainerBuilder A ContainerBuilder instance
  */
 public function buildContainer(ParameterBagInterface $parameterBag)
 {
     ContainerBuilder::registerExtension(new MongoDBExtension($parameterBag->get('kernel.bundle_dirs'), $parameterBag->get('kernel.bundles'), $parameterBag->get('kernel.cache_dir')));
 }