Skip to content

Instantly share code, notes, and snippets.

@kmadejski
Created November 30, 2017 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmadejski/f8480e3e97864c6b3b82b295dde85deb to your computer and use it in GitHub Desktop.
Save kmadejski/f8480e3e97864c6b3b82b295dde85deb to your computer and use it in GitHub Desktop.
<?php
namespace EzSystems\TestBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\SiteAccessAware\Configuration as SiteAccessConfiguration;
/**
* 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 extends SiteAccessConfiguration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('ez_systems_test');
$systemNode = $this->generateScopeBaseNode($rootNode);
$systemNode
->scalarNode('other_setting')->end()
->arrayNode('include_content_types')
->prototype('scalar')->end()
->end();
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
return $treeBuilder;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment