mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
add declaration for customizables classes refs #265
This commit is contained in:
@@ -24,5 +24,12 @@ class ChillCustomFieldsExtension extends Extension
|
||||
|
||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
$loader->load('services.yml');
|
||||
|
||||
//add at least a blank array at 'customizable_entities' options
|
||||
$customizable_entities = (isset($config['customizables_entities'])
|
||||
&& count($config['customizables_entities']) > 0)
|
||||
? $config['customizables_entities'] : array();
|
||||
|
||||
$container->setParameter('chill_custom_fields.customizable_entities', $customizable_entities);
|
||||
}
|
||||
}
|
||||
|
@@ -18,11 +18,22 @@ class Configuration implements ConfigurationInterface
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder();
|
||||
$rootNode = $treeBuilder->root('cl_custom_fields');
|
||||
$rootNode = $treeBuilder->root('chill_custom_fields');
|
||||
|
||||
$classInfo = "The class which may receive custom fields";
|
||||
$nameInfo = "The name which will appears in the user interface. May be translatable";
|
||||
|
||||
// Here you should define the parameters that are allowed to
|
||||
// configure your bundle. See the documentation linked above for
|
||||
// more information on that topic.
|
||||
$rootNode
|
||||
->children()
|
||||
->arrayNode('customizables_entities')
|
||||
->prototype('array')
|
||||
->children()
|
||||
->scalarNode('class')->isRequired()->info($classInfo)->end()
|
||||
->scalarNode('name') ->isRequired()->info($nameInfo) ->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
;
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
|
Reference in New Issue
Block a user