108 lines
5.1 KiB
PHP
108 lines
5.1 KiB
PHP
<?php
|
|
|
|
namespace Trinity\Bundle\AdminMenuBundle\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_admin_menu');
|
|
|
|
$rootNode
|
|
->children()
|
|
->arrayNode('menu')
|
|
->children()
|
|
->scalarNode('template')->defaultValue('TrinityAdminMenuBundle:Default:mainMenu.html.twig')->end()
|
|
->scalarNode('title')->defaultValue('Admin menu')->end()
|
|
->scalarNode('logo')->defaultValue('/bundles/trinityadminmenu/img/logo.png')->end()
|
|
->scalarNode('route_name')->defaultValue('TrinityDashBoardBundle_index')->end()
|
|
|
|
->arrayNode('items')
|
|
->prototype('array')
|
|
->children()
|
|
->scalarNode('title')
|
|
->defaultValue('Undefined title')
|
|
->end()
|
|
->arrayNode('items')
|
|
->prototype('array')
|
|
->children()
|
|
->arrayNode('callback')
|
|
->prototype('scalar')->end()
|
|
->end()
|
|
->scalarNode('title')
|
|
->defaultValue('Undefined title')
|
|
->end()
|
|
->scalarNode('route_uri')
|
|
->cannotBeEmpty()
|
|
->end()
|
|
->scalarNode('route_name')
|
|
->cannotBeEmpty()
|
|
->end()
|
|
->scalarNode('icon')
|
|
->cannotBeEmpty()
|
|
->end()
|
|
->variableNode('route_params')->end()
|
|
->scalarNode('title')
|
|
->defaultValue('Undefined')
|
|
->end()
|
|
->scalarNode('query_string')
|
|
->defaultValue('')
|
|
->end()
|
|
->booleanNode('test_is_granted')
|
|
->defaultTrue()
|
|
->end()
|
|
->arrayNode('items')
|
|
->prototype('array')
|
|
->children()
|
|
->arrayNode('callback')
|
|
->prototype('scalar')->end()
|
|
->end()
|
|
->scalarNode('title')
|
|
->defaultValue('Undefined title')
|
|
->end()
|
|
->scalarNode('route_uri')
|
|
->cannotBeEmpty()
|
|
->end()
|
|
->scalarNode('route_name')
|
|
->cannotBeEmpty()
|
|
->end()
|
|
->scalarNode('icon')
|
|
->cannotBeEmpty()
|
|
->end()
|
|
->scalarNode('query_string')
|
|
->defaultValue('')
|
|
->end()
|
|
->arrayNode('route_params')
|
|
->end()
|
|
->scalarNode('title')
|
|
->defaultValue("Undefined")
|
|
->end()
|
|
->booleanNode("test_is_granted")
|
|
->defaultTrue()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
->end()
|
|
;
|
|
|
|
return $treeBuilder;
|
|
}
|
|
}
|