Add configuration on id_document_types to avoid errors

This commit is contained in:
Julie Lenaerts 2024-07-11 15:15:04 +02:00
parent 0474b25859
commit 8d543be5cc
2 changed files with 27 additions and 0 deletions

View File

@ -193,6 +193,11 @@ class ChillMainExtension extends Extension implements
[]
);
$container->setParameter(
'chill_main.id_document_kinds',
$config['id_document_kinds']
);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config'));
$loader->load('services.yaml');
$loader->load('services/doctrine.yaml');

View File

@ -151,6 +151,28 @@ class Configuration implements ConfigurationInterface
->append($this->addWidgetsConfiguration('homepage', $this->containerBuilder))
->end() // end of widgets/children
->end() // end of widgets
->arrayNode('id_document_kinds')->defaultValue([])
->arrayPrototype()
->children()
->scalarNode('key')->isRequired()->cannotBeEmpty()
->info('the key stored in database')
->example('id_card')
->end()
->arrayNode('labels')->isRequired()->requiresAtLeastOneElement()
->arrayPrototype()
->children()
->scalarNode('lang')->isRequired()->cannotBeEmpty()
->example('fr')
->end()
->scalarNode('label')->isRequired()->cannotBeEmpty()
->example('Carte de séjour')
->end()
->end()
->end()
->end()
->end()
->end()
->end() // end of document types
->arrayNode('cruds')
->defaultValue([])
->arrayPrototype()