allow empty configuration for widgets

This commit is contained in:
Julien Fastré 2016-10-20 12:07:48 +02:00
parent 010c7652a6
commit 7c6d446b87
3 changed files with 7 additions and 2 deletions

1
.gitignore vendored
View File

@ -31,3 +31,4 @@ Resources/public/sass/*
!Resources/public/sass/_timeline.scss
!Resources/public/sass/custom/
/nbproject/private/

View File

@ -77,7 +77,10 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
// add the key 'widget' without the key 'enable'
$container->setParameter('chill_main.widgets',
array('homepage' => $config['widgets']['homepage']));
isset($config['widgets']['homepage']) ?
array('homepage' => $config['widgets']['homepage']):
array()
);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');

View File

@ -68,7 +68,8 @@ class Configuration implements ConfigurationInterface
->end() // end of children
->end() // end of pagination
->arrayNode('widgets')
->canBeDisabled()
->canBeEnabled()
->canBeUnset()
->children()
->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder))
->end() // end of widgets/children