File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,29 @@ has a certain value:
212
212
->end()
213
213
;
214
214
215
+ Optional Sections
216
+ -----------------
217
+ If you have entire sections which are optional and can be enabled/disabled,
218
+ you can take advantage of the shortcut ``canBeEnabled ``, or ``canBeDisabled ``::
219
+
220
+ $arrayNode
221
+ ->canBeEnabled()
222
+ ;
223
+
224
+ // is equivalent to
225
+
226
+ $arrayNode
227
+ ->treatFalseLike(array('enabled' => false))
228
+ ->treatTrueLike(array('enabled' => true))
229
+ ->treatNullLike(array('enabled' => true))
230
+ ->children()
231
+ ->booleanNode('enabled')
232
+ ->defaultFalse()
233
+ ;
234
+
235
+ ``canBeDisabled `` looks about the same with the difference that the section
236
+ would be enabled by default.
237
+
215
238
Merging options
216
239
---------------
217
240
You can’t perform that action at this time.
0 commit comments