11.. index ::
22 single: Config; Defining and processing configuration values
33
4- Defining and processing configuration values
4+ Defining and Processing Configuration Values
55============================================
66
7- Validating configuration values
7+ Validating Configuration Values
88-------------------------------
99
1010After loading configuration values from all kinds of resources, the values
@@ -38,7 +38,7 @@ they are when first encountered. Also, some keys are only available when
3838another key has a specific value (in the sample configuration above: the
3939``memory `` key only makes sense when the ``driver `` is ``sqlite ``).
4040
41- Defining a hierarchy of configuration values using the TreeBuilder
41+ Defining a Hierarchy of Configuration Values Using the TreeBuilder
4242------------------------------------------------------------------
4343
4444All the rules concerning configuration values can be defined using the
@@ -66,10 +66,10 @@ should be returned from a custom ``Configuration`` class which implements the
6666 }
6767 }
6868
69- Adding node definitions to the tree
69+ Adding Node Definitions to the Tree
7070-----------------------------------
7171
72- Variable nodes
72+ Variable Nodes
7373~~~~~~~~~~~~~~
7474
7575A tree contains node definitions which can be laid out in a semantic way.
@@ -91,7 +91,7 @@ The root node itself is an array node, and has children, like the boolean
9191node ``auto_connect `` and the scalar node ``default_connection ``. In general:
9292after defining a node, a call to ``end() `` takes you one step up in the hierarchy.
9393
94- Node type
94+ Node Type
9595~~~~~~~~~
9696
9797It is possible to validate the type of a provided value by using the appropriate
@@ -108,7 +108,7 @@ node definition. Node type are available for:
108108and are created with ``node($name, $type) `` or their associated shortcut
109109``xxxxNode($name) `` method.
110110
111- Numeric node constraints
111+ Numeric Node Constraints
112112~~~~~~~~~~~~~~~~~~~~~~~~
113113
114114Numeric nodes (float and integer) provide two extra constraints -
@@ -130,7 +130,7 @@ allowing to validate the value::
130130 ->end()
131131 ;
132132
133- Enum nodes
133+ Enum Nodes
134134~~~~~~~~~~
135135
136136Enum nodes provide a constraint to match the given input against a set of
@@ -146,7 +146,7 @@ values::
146146
147147This will restrict the ``gender `` option to be either ``male `` or ``female ``.
148148
149- Array nodes
149+ Array Nodes
150150~~~~~~~~~~~
151151
152152It is possible to add a deeper level to the hierarchy, by adding an array
@@ -187,7 +187,7 @@ inside the current node. According to the prototype definition in the example
187187above, it is possible to have multiple connection arrays (containing a ``driver ``,
188188``host ``, etc.).
189189
190- Array node options
190+ Array Node Options
191191~~~~~~~~~~~~~~~~~~
192192
193193Before defining the children of an array node, you can provide options like:
@@ -230,7 +230,7 @@ In XML, each ``parameters`` node would have a ``name`` attribute (along with
230230the final array. The ``useAttributeAsKey `` is useful for normalizing how
231231arrays are specified between different formats like XML and YAML.
232232
233- Default and required values
233+ Default and required Values
234234---------------------------
235235
236236For all node types, it is possible to define default values and replacement
@@ -307,7 +307,7 @@ you can take advantage of the shortcut
307307The ``canBeDisabled `` method looks about the same except that the section
308308would be enabled by default.
309309
310- Merging options
310+ Merging Options
311311---------------
312312
313313Extra options concerning the merge process may be provided. For arrays:
@@ -321,7 +321,7 @@ For all nodes:
321321``cannotBeOverwritten() ``
322322 don’t let other configuration arrays overwrite an existing value for this node
323323
324- Appending sections
324+ Appending Sections
325325------------------
326326
327327If you have a complex configuration to validate then the tree can grow to
@@ -493,7 +493,7 @@ By changing a string value into an associative array with ``name`` as the key::
493493 ->end()
494494 ;
495495
496- Validation rules
496+ Validation Rules
497497----------------
498498
499499More advanced validation rules can be provided using the
@@ -539,7 +539,7 @@ Usually, "then" is a closure. Its return value will be used as a new value
539539for the node, instead
540540of the node's original value.
541541
542- Processing configuration values
542+ Processing Configuration Values
543543-------------------------------
544544
545545The :class: `Symfony\\ Component\\ Config\\ Definition\\ Processor ` uses the tree
0 commit comments