@@ -788,6 +788,48 @@ A validation rule also requires a "then" part:
788
788
Usually, "then" is a closure. Its return value will be used as a new value
789
789
for the node, instead of the node's original value.
790
790
791
+ Configuring the Node Path Separator
792
+ -----------------------------------
793
+
794
+ .. versionadded :: 4.1
795
+ The option to configure the node path separator was introduced in Symfony 4.1.
796
+
797
+ Consider the following config builder example::
798
+
799
+ $treeBuilder = new TreeBuilder();
800
+ $rootNode = $treeBuilder->root('database');
801
+
802
+ $rootNode
803
+ ->children()
804
+ ->arrayNode('connection')
805
+ ->children()
806
+ ->scalarNode('driver')->end()
807
+ ->end()
808
+ ->end()
809
+ ->end()
810
+ ;
811
+
812
+ By default, the hierarchy of nodes in a config path is defined with a dot
813
+ character (``. ``)::
814
+
815
+ // ...
816
+
817
+ $node = $treeBuilder->buildTree();
818
+ $children = $node->getChildren();
819
+ $path = $children['driver']->getPath();
820
+ // $path = 'database.connection.driver'
821
+
822
+ Use the ``setPathSeparator() `` method on the config builder to change the path
823
+ separator::
824
+
825
+ // ...
826
+
827
+ $treeBuilder->setPathSeparator('/');
828
+ $node = $treeBuilder->buildTree();
829
+ $children = $node->getChildren();
830
+ $path = $children['driver']->getPath();
831
+ // $path = 'database/connection/driver'
832
+
791
833
Processing Configuration Values
792
834
-------------------------------
793
835
0 commit comments