@@ -186,6 +186,25 @@ The configuration can now be written like this::
186
186
->end()
187
187
;
188
188
189
+ You can also use the ``enumClass() `` method to pass the FQCN of an enum
190
+ class to the node. This will automatically set the values of the node to
191
+ the cases of the enum::
192
+
193
+ $rootNode
194
+ ->children()
195
+ ->enumNode('delivery')
196
+ ->enumClass(Delivery::class)
197
+ ->end()
198
+ ->end()
199
+ ;
200
+
201
+ When using a backed enum, the values provided to the node will be cast
202
+ to one of the enum cases if possible.
203
+
204
+ .. versionadded :: 7.3
205
+
206
+ The ``enumClass() `` method was introduced in Symfony 7.3.
207
+
189
208
Array Nodes
190
209
~~~~~~~~~~~
191
210
@@ -527,6 +546,30 @@ and in XML:
527
546
<!-- entries-per-page: This value is only used for the search results page. -->
528
547
<config entries-per-page =" 25" />
529
548
549
+ You can also provide a URL to a full documentation page::
550
+
551
+ $rootNode
552
+ ->docUrl('Full documentation is available at https://example.com/docs/{version:major}.{version:minor}/reference.html')
553
+ ->children()
554
+ ->integerNode('entries_per_page')
555
+ ->defaultValue(25)
556
+ ->end()
557
+ ->end()
558
+ ;
559
+
560
+ A few placeholders are available to customize the URL:
561
+
562
+ * ``{version:major} ``: The major version of the package currently installed
563
+ * ``{version:minor} ``: The minor version of the package currently installed
564
+ * ``{package} ``: The name of the package
565
+
566
+ The placeholders will be replaced when printing the configuration tree with the
567
+ ``config:dump-reference `` command.
568
+
569
+ .. versionadded :: 7.3
570
+
571
+ The ``docUrl() `` method was introduced in Symfony 7.3.
572
+
530
573
Optional Sections
531
574
-----------------
532
575
@@ -815,6 +858,7 @@ A validation rule always has an "if" part. You can specify this part in
815
858
the following ways:
816
859
817
860
- ``ifTrue() ``
861
+ - ``ifFalse() ``
818
862
- ``ifString() ``
819
863
- ``ifNull() ``
820
864
- ``ifEmpty() ``
@@ -833,6 +877,10 @@ A validation rule also requires a "then" part:
833
877
Usually, "then" is a closure. Its return value will be used as a new value
834
878
for the node, instead of the node's original value.
835
879
880
+ .. versionadded :: 7.3
881
+
882
+ The ``ifFalse() `` method was introduced in Symfony 7.3.
883
+
836
884
Configuring the Node Path Separator
837
885
-----------------------------------
838
886
0 commit comments