100 lines
3.3 KiB
PHP
100 lines
3.3 KiB
PHP
<?php
|
|
|
|
namespace Trinity\Bundle\ContentManagerBundle\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('trinity_content_manager');
|
|
|
|
$rootNode->children()
|
|
->scalarNode('decorator_strategy')->isRequired()->end()
|
|
|
|
->booleanNode('index_use_nav_name')->defaultFalse()->end()
|
|
|
|
->arrayNode('ignore_route_patterns')
|
|
->defaultValue(array(
|
|
'(.*)admin(.*)', # ignore admin route, ie route containing 'admin'
|
|
'^_(.*)', # ignore symfony routes
|
|
'^fos_user_(.*)',
|
|
))
|
|
->prototype('scalar')->end()
|
|
->end()
|
|
|
|
->arrayNode('ignore_routes')
|
|
->defaultValue(array(
|
|
'index',
|
|
))
|
|
->prototype('scalar')->end()
|
|
->end()
|
|
|
|
->arrayNode('ignore_uri_patterns')
|
|
->defaultValue(array(
|
|
'/admin(.*)', # ignore admin route, ie route containing 'admin'
|
|
))
|
|
->prototype('scalar')->end()
|
|
->end()
|
|
->arrayNode('ignore_routes')
|
|
->defaultValue(array(
|
|
'index',
|
|
))
|
|
->prototype('scalar')->end()
|
|
->end()
|
|
|
|
->arrayNode('url_resolver')
|
|
->children()
|
|
->arrayNode('models')
|
|
->prototype('array')
|
|
->children()
|
|
->arrayNode('params')
|
|
->prototype('scalar')->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
|
|
->arrayNode('page')
|
|
->children()
|
|
->arrayNode('models')
|
|
->prototype('array')
|
|
->children()
|
|
->scalarNode('title')
|
|
->isRequired()
|
|
->end()
|
|
->arrayNode('templates')
|
|
->isRequired()
|
|
->prototype('array')
|
|
->children()
|
|
->scalarNode('title')
|
|
->isRequired()
|
|
->end()
|
|
->scalarNode('template')
|
|
->isRequired()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
;
|
|
|
|
return $treeBuilder;
|
|
}
|
|
}
|