3 namespace Rapsys\AirBundle\DependencyInjection
;
5 use Symfony\Component\Config\Definition\Builder\TreeBuilder
;
6 use Symfony\Component\Config\Definition\ConfigurationInterface
;
9 * This is the class that validates and merges configuration from your app/config files.
11 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
13 class Configuration
implements ConfigurationInterface
{
17 public function getConfigTreeBuilder() {
18 $treeBuilder = new TreeBuilder('rapsys_air');
20 // Here you should define the parameters that are allowed to
21 // configure your bundle. See the documentation linked above for
22 // more information on that topic.
26 'logo' => '@RapsysAir/../public/png/logo.png',
27 'title' => 'Air Libre'
30 'long' => 'John Doe all rights reserved',
31 'short' => 'Copyright 2019'
35 'mail' => 'contact@example.com'
39 //Here we define the parameters that are allowed to configure the bundle.
40 //TODO: see https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php for default value and description
41 //TODO: see http://symfony.com/doc/current/components/config/definition.html
42 //XXX: use bin/console config:dump-reference to dump class infos
44 //Here we define the parameters that are allowed to configure the bundle.
48 ->addDefaultsIfNotSet()
51 ->addDefaultsIfNotSet()
53 ->scalarNode('logo')->cannotBeEmpty()->defaultValue($defaults['site']['logo'])->end()
54 ->scalarNode('title')->cannotBeEmpty()->defaultValue($defaults['site']['title'])->end()
58 ->addDefaultsIfNotSet()
60 ->scalarNode('long')->defaultValue($defaults['copy']['long'])->end()
61 ->scalarNode('short')->defaultValue($defaults['copy']['short'])->end()
64 ->arrayNode('contact')
65 ->addDefaultsIfNotSet()
67 ->scalarNode('name')->cannotBeEmpty()->defaultValue($defaults['contact']['name'])->end()
68 ->scalarNode('mail')->cannotBeEmpty()->defaultValue($defaults['contact']['mail'])->end()