aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/DependencyInjection
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-10-01 16:28:38 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-10-15 21:42:29 +0200
commitc89d35e851d26b78f89bd7ece5e3eaa109c8cac0 (patch)
tree554523b6b376d258fbf82b8ef8ec16236f774b5f /src/Wallabag/CoreBundle/DependencyInjection
parent3d3ed955f11006a408c6596eb9151a0afb28e721 (diff)
downloadwallabag-c89d35e851d26b78f89bd7ece5e3eaa109c8cac0.tar.gz
wallabag-c89d35e851d26b78f89bd7ece5e3eaa109c8cac0.tar.zst
wallabag-c89d35e851d26b78f89bd7ece5e3eaa109c8cac0.zip
Language selection on config screen
Diffstat (limited to 'src/Wallabag/CoreBundle/DependencyInjection')
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/Configuration.php25
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php4
2 files changed, 29 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
new file mode 100644
index 00000000..32acd1f1
--- /dev/null
+++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
@@ -0,0 +1,25 @@
1<?php
2
3namespace Wallabag\CoreBundle\DependencyInjection;
4
5use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6use Symfony\Component\Config\Definition\ConfigurationInterface;
7
8class Configuration implements ConfigurationInterface
9{
10 public function getConfigTreeBuilder()
11 {
12 $treeBuilder = new TreeBuilder();
13 $rootNode = $treeBuilder->root('wallabag_core');
14
15 $rootNode
16 ->children()
17 ->arrayNode('languages')
18 ->prototype('scalar')->end()
19 ->end()
20 ->end()
21 ;
22
23 return $treeBuilder;
24 }
25}
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
index 7493351b..330cc957 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
@@ -11,6 +11,10 @@ class WallabagCoreExtension extends Extension
11{ 11{
12 public function load(array $configs, ContainerBuilder $container) 12 public function load(array $configs, ContainerBuilder $container)
13 { 13 {
14 $configuration = new Configuration();
15 $config = $this->processConfiguration($configuration, $configs);
16 $container->setParameter('wallabag_core.languages', $config['languages']);
17
14 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 18 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
15 $loader->load('services.yml'); 19 $loader->load('services.yml');
16 } 20 }