mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-27 18:13:48 +00:00
replacing delegated_block api by widget api
This commit is contained in:
@@ -4,14 +4,34 @@ namespace Chill\MainBundle\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
|
||||
/**
|
||||
* This is the class that validates and merges configuration from your app/config files
|
||||
*
|
||||
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
|
||||
* Configure the main bundle
|
||||
*/
|
||||
class Configuration implements ConfigurationInterface
|
||||
{
|
||||
|
||||
use AddWidgetConfigurationTrait;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var ContainerBuilder
|
||||
*/
|
||||
private $containerBuilder;
|
||||
|
||||
|
||||
public function __construct(array $widgetFactories = array(),
|
||||
ContainerBuilder $containerBuilder)
|
||||
{
|
||||
$this->setWidgetFactories($widgetFactories);
|
||||
$this->containerBuilder = $containerBuilder;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@@ -25,18 +45,18 @@ class Configuration implements ConfigurationInterface
|
||||
->scalarNode('installation_name')
|
||||
->cannotBeEmpty()
|
||||
->defaultValue('Chill')
|
||||
->end()
|
||||
->end() // end of scalar 'installation_name'
|
||||
->arrayNode('available_languages')
|
||||
->defaultValue(array('fr'))
|
||||
->prototype('scalar')->end()
|
||||
->end()
|
||||
->end() // end of array 'available_languages'
|
||||
->arrayNode('routing')
|
||||
->children()
|
||||
->arrayNode('resources')
|
||||
->prototype('scalar')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end() // end of array 'resources'
|
||||
->end() // end of children
|
||||
->end() // end of array node 'routing'
|
||||
->arrayNode('pagination')
|
||||
->canBeDisabled()
|
||||
->children()
|
||||
@@ -44,11 +64,20 @@ class Configuration implements ConfigurationInterface
|
||||
->info('The number of item to show in the page result, by default')
|
||||
->min(1)
|
||||
->defaultValue(50)
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
->end() // end of integer 'item_per_page'
|
||||
->end() // end of children
|
||||
->end() // end of pagination
|
||||
->arrayNode('widgets')
|
||||
->canBeDisabled()
|
||||
->children()
|
||||
->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder))
|
||||
->end() // end of widgets/children
|
||||
->end() // end of widgets
|
||||
->end() // end of root/children
|
||||
->end() // end of root
|
||||
;
|
||||
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user