@@ -48,10 +48,12 @@ A) The ``FormEvents::PRE_SET_DATA`` Event
4848.........................................
4949
5050The ``FormEvents::PRE_SET_DATA `` event is dispatched at the beginning of the
51- ``Form::setData() `` method. It can be used to:
52-
53- * Modify the data given during pre-population;
54- * Modify a form depending on the pre-populated data (adding or removing fields dynamically).
51+ ``Form::setData() `` method. It is used to modify the data given during
52+ pre-population with
53+ :method: `FormEvent::setData() <Symfony\\ Component\\ Form\\ FormEvent::setData> `.
54+ The method :method: `Form::setData() <Symfony\\ Component\\ Form\\ Form::setData> `
55+ is locked since the event is dispatched from it and will throw an exception
56+ if called from a listener.
5557
5658=============== ========
5759Data Type Value
@@ -66,13 +68,6 @@ View data ``null``
6668 See all form events at a glance in the
6769 :ref: `Form Events Information Table <component-form-event-table >`.
6870
69- .. caution ::
70-
71- During ``FormEvents::PRE_SET_DATA ``,
72- :method: `Form::setData() <Symfony\\ Component\\ Form\\ Form::setData> `
73- is locked and will throw an exception if used. If you wish to modify
74- data, you should use
75- :method: `FormEvent::setData() <Symfony\\ Component\\ Form\\ FormEvent::setData> `
7671 instead.
7772
7873.. sidebar :: ``FormEvents::PRE_SET_DATA`` in the Form component
@@ -88,8 +83,8 @@ B) The ``FormEvents::POST_SET_DATA`` Event
8883
8984The ``FormEvents::POST_SET_DATA `` event is dispatched at the end of the
9085:method: `Form::setData() <Symfony\\ Component\\ Form\\ Form::setData> `
91- method. This event is mostly here for reading data after having pre- populated
92- the form .
86+ method. This event can be used to modify a form depending on the populated data
87+ (adding or removing fields dynamically) .
9388
9489=============== ====================================================
9590Data Type Value
0 commit comments