<?php

namespace DMS\Bundle\TwigExtensionBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
 * This is the class that validates and merges configuration from your app/config files
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
 */
class Configuration implements ConfigurationInterface
{
    /**
     * {@inheritDoc}
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('dms_twig_extension');

        $rootNode->children()
            ->arrayNode('fabpot')
                ->addDefaultsIfNotSet()
                ->children()
                    ->booleanNode('i18n')->defaultFalse()->end()
                    ->booleanNode('debug')->defaultFalse()->end()
                    ->booleanNode('text')->defaultTrue()->end()
                    ->booleanNode('intl')->defaultTrue()->end()
                ->end()
            ->end();

        $rootNode->children()
            ->arrayNode('dms')
                ->addDefaultsIfNotSet()
                ->children()
                    ->booleanNode('textual_date')->defaultTrue()->end()
                ->end()
            ->end();

        return $treeBuilder;
    }
}

<?php

namespace DMS\Bundle\TwigExtensionBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
 * This is the class that validates and merges configuration from your app/config files
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
 */
class Configuration implements ConfigurationInterface
{
    /**
     * {@inheritDoc}
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('dms_twig_extension');

        $rootNode->children()
            ->arrayNode('fabpot')
                ->addDefaultsIfNotSet()
                ->children()
                    ->booleanNode('i18n')->defaultFalse()->end()
                    ->booleanNode('debug')->defaultFalse()->end()
                    ->booleanNode('text')->defaultTrue()->end()
                    ->booleanNode('intl')->defaultTrue()->end()
                ->end()
            ->end();

        $rootNode->children()
            ->arrayNode('dms')
                ->addDefaultsIfNotSet()
                ->children()
                    ->booleanNode('textual_date')->defaultTrue()->end()
                    ->booleanNode('pad_string')->defaultTrue()->end()
                ->end()
            ->end();

        return $treeBuilder;
    }
}

Add extension to DI configuration
Add extension to DI configuration
