vendor/liip/theme-bundle/DependencyInjection/Configuration.php line 36

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Liip/ThemeBundle
  4.  *
  5.  * (c) Liip AG
  6.  *
  7.  * This source file is subject to the MIT license that is bundled
  8.  * with this source code in the file LICENSE.
  9.  */
  10. namespace Liip\ThemeBundle\DependencyInjection;
  11. use Symfony\Component\Config\Definition\ConfigurationInterface;
  12. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  13. /**
  14.  * This class contains the configuration information for the bundle.
  15.  *
  16.  * This information is solely responsible for how the different configuration
  17.  * sections are normalized, and merged.
  18.  *
  19.  * @author Tobias Ebnöther <ebi@liip.ch>
  20.  * @author Roland Schilter <roland.schilter@liip.ch>
  21.  * @author Paweł Jędrzejewski <pjedrzejewski@diweb.pl>
  22.  * @author Konstantin Myakshin <koc-dp@yandex.ru>
  23.  */
  24. class Configuration implements ConfigurationInterface
  25. {
  26.     /**
  27.      * {@inheritdoc}
  28.      */
  29.     public function getConfigTreeBuilder()
  30.     {
  31.         $treeBuilder = new TreeBuilder();
  32.         $rootNode $treeBuilder->root('liip_theme''array');
  33.         $rootNode
  34.             ->children()
  35.                 ->arrayNode('themes')
  36.                     ->useAttributeAsKey('theme')
  37.                     ->prototype('scalar')->end()
  38.                 ->end()
  39.                 ->scalarNode('active_theme')->defaultNull()->end()
  40.                 ->arrayNode('path_patterns')
  41.                     ->addDefaultsIfNotSet()
  42.                     ->children()
  43.                         ->arrayNode('app_resource')
  44.                             ->useAttributeAsKey('path')
  45.                             ->prototype('scalar')->end()
  46.                         ->end()
  47.                         ->arrayNode('bundle_resource')
  48.                             ->useAttributeAsKey('path')
  49.                             ->prototype('scalar')->end()
  50.                         ->end()
  51.                         ->arrayNode('bundle_resource_dir')
  52.                             ->useAttributeAsKey('path')
  53.                             ->prototype('scalar')->end()
  54.                         ->end()
  55.                     ->end()
  56.                 ->end()
  57.                 ->arrayNode('cookie')
  58.                     ->addDefaultsIfNotSet()
  59.                     ->children()
  60.                         ->scalarNode('name')->cannotBeEmpty()->end()
  61.                         ->scalarNode('lifetime')->defaultValue(31536000)->end()
  62.                         ->scalarNode('path')->defaultValue('/')->end()
  63.                         ->scalarNode('domain')->defaultValue('')->end()
  64.                         ->booleanNode('secure')->defaultFalse()->end()
  65.                         ->booleanNode('http_only')->defaultFalse()->end()
  66.                     ->end()
  67.                 ->end()
  68.                 ->scalarNode('autodetect_theme')->defaultFalse()->end()
  69.                 ->scalarNode('device_detection')->defaultFalse()->end()
  70.                 ->booleanNode('cache_warming')->defaultTrue()->end()
  71.                 ->booleanNode('load_controllers')->defaultTrue()->end()
  72.                 ->booleanNode('assetic_integration')->defaultFalse()->end()
  73.                 ->booleanNode('theme_specific_controllers')->defaultFalse()->end()
  74.             ->end()
  75.         ;
  76.         return $treeBuilder;
  77.     }
  78. }