setWidgetFactories($widgetFactories); $this->containerBuilder = $containerBuilder; } /** * {@inheritDoc} */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('chill_main'); $rootNode ->children() ->scalarNode('installation_name') ->cannotBeEmpty() ->defaultValue('Chill') ->end() // end of scalar 'installation_name' ->arrayNode('available_languages') ->defaultValue(array('fr')) ->prototype('scalar')->end() ->end() // end of array 'available_languages' ->arrayNode('routing') ->children() ->arrayNode('resources') ->prototype('scalar')->end() ->end() // end of array 'resources' ->end() // end of children ->end() // end of array node 'routing' ->arrayNode('pagination') ->canBeDisabled() ->children() ->integerNode('item_per_page') ->info('The number of item to show in the page result, by default') ->min(1) ->defaultValue(50) ->end() // end of integer 'item_per_page' ->end() // end of children ->end() // end of pagination ->arrayNode('notifications') ->children() ->scalarNode('from_email') ->cannotBeEmpty() ->end() ->scalarNode('from_name') ->cannotBeEmpty() ->end() ->enumNode('scheme') ->cannotBeEmpty() ->values(['http', 'https']) ->defaultValue('https') ->end() ->scalarNode('host') ->cannotBeEmpty() ->end() ->end() ->end() // end of notifications ->arrayNode('phone_helper') ->canBeUnset() ->children() ->scalarNode('twilio_sid') ->defaultNull() ->end() ->scalarNode('twilio_secret') ->defaultNull() ->end() ->end() ->end() ->arrayNode('redis') ->children() ->scalarNode('host') ->cannotBeEmpty() ->end() ->scalarNode('port') ->defaultValue(6379) ->end() ->scalarNode('timeout') ->defaultValue(1) ->end() ->end() ->end() ->arrayNode('widgets') ->canBeEnabled() ->canBeUnset() ->children() ->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder)) ->end() // end of widgets/children ->end() // end of widgets ->end() // end of root/children ->end() // end of root ; return $treeBuilder; } }