Skip to content
Advertisement

How to parse simple key => value pairs using symfony config component

I am trying to integrate Symfony config component and have some trouble getting it to parse required YAML format. I can’t find a way for the Config component to accept simple key => value pairs from the YAML file.

My current tree builder for the “limits” section:

JavaScript

The yaml tree that I am already able to parse is as follows:

JavaScript

And I want to modify it so I can write configuration like this:

JavaScript

Any idea how I could modify the tree builder to get the required format?

thanks!

Advertisement

Answer

starting from your code, changing your thresholds definition to this, should do what you expect :

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement