vendor/sogec/bo-bundle/DependencyInjection/Configuration.php line 16

Open in your IDE?
  1. <?php
  2. namespace Sogec\BOBundle\DependencyInjection;
  3. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  4. use Symfony\Component\Config\Definition\ConfigurationInterface;
  5. /**
  6.  * Class Configuration.
  7.  */
  8. class Configuration implements ConfigurationInterface
  9. {
  10.     public function getConfigTreeBuilder()
  11.     {
  12.         $treeBuilder = new TreeBuilder();
  13.         $rootNode $treeBuilder->root('crud_generic');
  14.         $rootNode
  15.             ->children()
  16.                 ->scalarNode('date_format')
  17.                     ->defaultValue('Y-m-d')
  18.                 ->end()
  19.                 ->scalarNode('datetime_format')
  20.                     ->defaultValue('Y-m-d H:i:s')
  21.                 ->end()
  22.                 ->arrayNode('entities')
  23.                     ->normalizeKeys(false)
  24.                     ->useAttributeAsKey('name'false)
  25.                     ->defaultValue(array())
  26.                     ->info('The list of entities to manage in the administration zone.')
  27.                     ->prototype('variable')
  28.                 ->end()
  29.             ->end()
  30.         ;
  31.         $rootNode
  32.             ->children()
  33.                 ->arrayNode('list')
  34.                     ->addDefaultsIfNotSet()
  35.                         ->children()
  36.                             ->scalarNode('title')
  37.                                 ->info('The visible page title displayed in the list view.')
  38.                             ->end()
  39.                             ->arrayNode('actions')
  40.                                 ->prototype('variable')->end()
  41.                                 ->info('The list of actions enabled in the "list" view.')
  42.                             ->end()
  43.                             ->integerNode('max_results')
  44.                                 ->defaultValue(15)
  45.                                 ->info('The maximum number of items to show on listing and search pages.')
  46.                         ->end()
  47.                 ->end()
  48.             ->end()
  49.             ->arrayNode('edit')
  50.                 ->addDefaultsIfNotSet()
  51.                     ->children()
  52.                         ->scalarNode('title')
  53.                             ->info('The visible page title displayed in the edit view.')
  54.                         ->end()
  55.                         ->arrayNode('actions')
  56.                             ->prototype('variable')->end()
  57.                             ->info('The list of actions enabled in the "edit" view.')
  58.                     ->end()
  59.                 ->end()
  60.             ->end()
  61.             ->arrayNode('new')
  62.                 ->addDefaultsIfNotSet()
  63.                     ->children()
  64.                         ->scalarNode('title')
  65.                             ->info('The visible page title displayed in the new view.')
  66.                         ->end()
  67.                         ->arrayNode('actions')
  68.                             ->prototype('variable')->end()
  69.                             ->info('The list of actions enabled in the "new" view.')
  70.                     ->end()
  71.                 ->end()
  72.             ->end()
  73.             ->arrayNode('show')
  74.                 ->addDefaultsIfNotSet()
  75.                     ->children()
  76.                         ->scalarNode('title')
  77.                             ->info('The visible page title displayed in the show view.')
  78.                         ->end()
  79.                         ->arrayNode('actions')
  80.                             ->prototype('variable')->end()
  81.                             ->info('The list of actions enabled in the "show" view.')
  82.                         ->end()
  83.                         ->integerNode('max_results')
  84.                             ->defaultValue(10)
  85.                             ->info('The maximum number of items displayed for related fields in the show page and for autocomplete fields in the new/edit pages.')
  86.                         ->end()
  87.                     ->end()
  88.                 ->end()
  89.             ->end()
  90.         ;
  91.         return $treeBuilder;
  92.     }
  93. }