Quellcode durchsuchen

Add tip about 'required' in sonata_type_collection

Document 'required' option behavior in sonata_type_collection
Eike Send vor 11 Jahren
Ursprung
Commit
9a57a7b815
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  1. 3 0
      Resources/doc/reference/form_types.rst

+ 3 - 0
Resources/doc/reference/form_types.rst

@@ -346,6 +346,9 @@ btn_add and btn_catalogue:
 **TIP**: A jQuery event is fired after a row has been added (``sonata-admin-append-form-element``).
 You can listen to this event to trigger custom javascript (eg: add a calendar widget to a newly added date field)
 
+**TIP**: Setting the 'required' option to true does not cause a requirement of 'at least one' child entity. 
+Setting the 'required' option to false causes all nested form fields to become not required as well.
+
 sonata_type_native_collection (previously collection)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^