]> Raphaƫl G. Git Repositories - userbundle/blobdiff - DependencyInjection/Configuration.php
Rename title in civility
[userbundle] / DependencyInjection / Configuration.php
index a8c03248741ea3171636e2c41ee63606f14a76c8..81ec927c74113e6c03003765d3fa3997c3109cc3 100644 (file)
@@ -20,11 +20,15 @@ class Configuration implements ConfigurationInterface {
 
                //The bundle default values
                $defaults = [
-                       'class' => [
+                       'class' => [
                                'group' => 'Rapsys\\UserBundle\\Entity\\Group',
                                'title' => 'Rapsys\\UserBundle\\Entity\\Title',
                                'user' => 'Rapsys\\UserBundle\\Entity\\User'
                        ],
+                       'default' => [
+                               'title' => 'Mister',
+                               'group' => [ 'User' ]
+                       ],
                        'route' => [
                                'index' => [
                                        'name' => 'rapsys_user_index',
@@ -47,6 +51,11 @@ class Configuration implements ConfigurationInterface {
                                        'context' => []
                                ]
                        ],
+                       'translate' => [],
+                       'locales' => '%kernel.translator.fallbacks%',
+                       'languages' => [
+                               'en' => 'English'
+                       ],
                        'contact' => [
                                'name' => 'John Doe',
                                'mail' => 'contact@example.com'
@@ -123,6 +132,17 @@ class Configuration implements ConfigurationInterface {
                                                        ->scalarNode('user')->cannotBeEmpty()->defaultValue($defaults['class']['user'])->end()
                                                ->end()
                                        ->end()
+                                       ->arrayNode('default')
+                                               ->addDefaultsIfNotSet()
+                                               ->children()
+                                                       ->scalarNode('title')->cannotBeEmpty()->defaultValue($defaults['default']['title'])->end()
+                                                       ->arrayNode('group')
+                                                               ->treatNullLike(array())
+                                                               ->defaultValue($defaults['default']['group'])
+                                                               ->scalarPrototype()->end()
+                                                       ->end()
+                                               ->end()
+                                       ->end()
                                        ->arrayNode('route')
                                                ->addDefaultsIfNotSet()
                                                ->children()
@@ -183,6 +203,17 @@ class Configuration implements ConfigurationInterface {
                                                        ->end()
                                                ->end()
                                        ->end()
+                                       ->arrayNode('translate')
+                                               ->treatNullLike(array())
+                                               ->defaultValue($defaults['translate'])
+                                               ->scalarPrototype()->end()
+                                       ->end()
+                                       ->scalarNode('locales')->cannotBeEmpty()->defaultValue($defaults['locales'])->end()
+                                       ->arrayNode('languages')
+                                               ->treatNullLike([])
+                                               ->defaultValue($defaults['languages'])
+                                               ->scalarPrototype()->end()
+                                       ->end()
                                        ->arrayNode('contact')
                                                ->addDefaultsIfNotSet()
                                                ->children()