allow empty configuration for widgets

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

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');