Permalink
Browse files

added a enabled option

  • Loading branch information...
1 parent d5e1169 commit b938368d2016391f953169483436d021733f65a9 @docteurklein committed Feb 15, 2012
Showing with 5 additions and 0 deletions.
  1. +1 −0 DependencyInjection/Configuration.php
  2. +4 −0 DependencyInjection/KnpTranslatorExtension.php
View
1 DependencyInjection/Configuration.php
@@ -23,6 +23,7 @@ public function getConfigTreeBuilder()
$rootNode
->children()
->booleanNode('include_vendor_assets')->defaultTrue()->end()
+ ->booleanNode('enabled')->defaultTrue()->end()
->end()
;
View
4 DependencyInjection/KnpTranslatorExtension.php
@@ -16,6 +16,10 @@ public function load(array $configs, ContainerBuilder $container)
$configuration = new Configuration();
$config = $processor->processConfiguration($configuration, $configs);
+ if (!$config['enabled']) {
+ return;
+ }
+
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
foreach (array('translation', 'controller') as $basename) {

0 comments on commit b938368

Please sign in to comment.