diff --git a/DependencyInjection/ChillMainExtension.php b/DependencyInjection/ChillMainExtension.php index 90baed222..166a5cb47 100644 --- a/DependencyInjection/ChillMainExtension.php +++ b/DependencyInjection/ChillMainExtension.php @@ -52,9 +52,9 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface $twigConfig = array( 'globals' => array( 'installation' => array( - 'name' => $config['installation_name'] - ), - 'date_format' => 'd-M-Y' + 'name' => $config['installation_name']), + 'date_format' => 'd-M-Y', + 'available_languages' => $config['available_languages'] ), 'form' => array( 'resources' => array('ChillMainBundle:Form:fields.html.twig')) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index d6398a98a..5290d12f3 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -27,6 +27,7 @@ class Configuration implements ConfigurationInterface ->defaultValue('Chill') ->end() ->arrayNode('available_languages') + ->defaultValue(array('fr')) ->prototype('scalar')->end() ->end() ->end(); diff --git a/Resources/views/layout.html.twig b/Resources/views/layout.html.twig index 17d07d1e9..95fb0f82a 100644 --- a/Resources/views/layout.html.twig +++ b/Resources/views/layout.html.twig @@ -50,16 +50,21 @@ 'layout': 'ChillMainBundle::Menu/user.html.twig', }) }} - - + {% if available_languages|length == 1 %} + + {% else %} + + {% endif %}