Chargement d'une configuration perso
Bonjour,
Je suis en train de mettre en place une extension twig et j'ai besoin de charger une configuration perso dans un fichier yml qui est la suivante :
Code:
1 2 3 4
|
section:
sous_section:
cle: "valeur" |
Dans ma classe MonBundleExtention dans la fonction load j'ai :
Code:
1 2 3 4 5 6 7
|
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader ->load('services.yml')
$loader->load('config.yml'); |
Et au chargement j'ai l'erreur suivante :
There is no extension able to load the configuration for "section"
J'ai essayer d'effectué une configuration dans la classe configuration
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| $rootNode = $treeBuilder->root('mon_bundle');
$rootNode
->children()
->arrayNode('section')
->children()
->arrayNode('sous_section')
->children()
->scalarNode("cle")->defaultValue("valeur")->end()
->end()
->end()
->end()
->end()
->end()
; |
Mais quand je fais un var dump de la configuration générée j'obtient un array vide.
Si quelqu'un à une idée.
Merci d'avance