@@ -60,8 +60,6 @@ The ``FormEvents::PRE_SET_DATA`` event is dispatched at the beginning of the
60
60
* Modify the data given during pre-population;
61
61
* Modify a form depending on the pre-populated data (adding or removing fields dynamically).
62
62
63
- :ref: `Form Events Information Table<component-form-event-table> `
64
-
65
63
=============== ========
66
64
Data Type Value
67
65
=============== ========
@@ -70,6 +68,11 @@ Normalized data ``null``
70
68
View data ``null ``
71
69
=============== ========
72
70
71
+ .. seealso ::
72
+
73
+ See all form events at a glance in the
74
+ :ref: `Form Events Information Table <component-form-event-table >`.
75
+
73
76
.. caution ::
74
77
75
78
During ``FormEvents::PRE_SET_DATA ``,
@@ -95,8 +98,6 @@ The ``FormEvents::POST_SET_DATA`` event is dispatched at the end of the
95
98
method. This event is mostly here for reading data after having pre-populated
96
99
the form.
97
100
98
- :ref: `Form Events Information Table<component-form-event-table> `
99
-
100
101
=============== ====================================================
101
102
Data Type Value
102
103
=============== ====================================================
@@ -105,6 +106,11 @@ Normalized data Model data transformed using a model transformer
105
106
View data Normalized data transformed using a view transformer
106
107
=============== ====================================================
107
108
109
+ .. seealso ::
110
+
111
+ See all form events at a glance in the
112
+ :ref: `Form Events Information Table <component-form-event-table >`.
113
+
108
114
.. sidebar :: ``FormEvents::POST_SET_DATA`` in the Form component
109
115
110
116
The ``Symfony\Component\Form\Extension\DataCollector\EventListener\DataCollectorListener ``
@@ -135,8 +141,6 @@ It can be used to:
135
141
* Change data from the request, before submitting the data to the form;
136
142
* Add or remove form fields, before submitting the data to the form.
137
143
138
- :ref: `Form Events Information Table<component-form-event-table> `
139
-
140
144
=============== ========================================
141
145
Data Type Value
142
146
=============== ========================================
@@ -145,6 +149,11 @@ Normalized data Same as in ``FormEvents::POST_SET_DATA``
145
149
View data Same as in ``FormEvents::POST_SET_DATA ``
146
150
=============== ========================================
147
151
152
+ .. seealso ::
153
+
154
+ See all form events at a glance in the
155
+ :ref: `Form Events Information Table <component-form-event-table >`.
156
+
148
157
.. sidebar :: ``FormEvents::PRE_SUBMIT`` in the Form component
149
158
150
159
The ``Symfony\Component\Form\Extension\Core\EventListener\TrimListener ``
@@ -163,8 +172,6 @@ transforms back the normalized data to the model and view data.
163
172
164
173
It can be used to change data from the normalized representation of the data.
165
174
166
- :ref: `Form Events Information Table<component-form-event-table> `
167
-
168
175
=============== ===================================================================================
169
176
Data Type Value
170
177
=============== ===================================================================================
@@ -173,6 +180,11 @@ Normalized data Data from the request reverse-transformed from the request usin
173
180
View data Same as in ``FormEvents::POST_SET_DATA ``
174
181
=============== ===================================================================================
175
182
183
+ .. seealso ::
184
+
185
+ See all form events at a glance in the
186
+ :ref: `Form Events Information Table <component-form-event-table >`.
187
+
176
188
.. caution ::
177
189
178
190
At this point, you cannot add or remove fields to the form.
@@ -193,16 +205,19 @@ model and view data have been denormalized.
193
205
194
206
It can be used to fetch data after denormalization.
195
207
196
- :ref: `Form Events Information Table<component-form-event-table> `
197
-
198
208
=============== =============================================================
199
209
Data Type Value
200
210
=============== =============================================================
201
211
Model data Normalized data reverse-transformed using a model transformer
202
- Normalized data Same as in ``FormEvents::POST_SUBMIT ``
212
+ Normalized data Same as in ``FormEvents::SUBMIT ``
203
213
View data Normalized data transformed using a view transformer
204
214
=============== =============================================================
205
215
216
+ .. seealso ::
217
+
218
+ See all form events at a glance in the
219
+ :ref: `Form Events Information Table <component-form-event-table >`.
220
+
206
221
.. caution ::
207
222
208
223
At this point, you cannot add or remove fields to the form.
@@ -214,21 +229,21 @@ View data Normalized data transformed using a view transformer
214
229
information about the forms.
215
230
The ``Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener ``
216
231
subscribes to the ``FormEvents::POST_SUBMIT `` event in order to
217
- automatically validate the denormalized object, and update the normalized
218
- as well as the view's representations.
232
+ automatically validate the denormalized object and to update the normalized
233
+ representation as well as the view representations.
219
234
220
235
Registering Event Listeners or Event Subscribers
221
236
------------------------------------------------
222
237
223
238
In order to be able to use Form events, you need to create an event listener
224
- or an event subscriber, and register it to an event.
239
+ or an event subscriber and register it to an event.
225
240
226
241
The name of each of the "form" events is defined as a constant on the
227
242
:class: `Symfony\\ Component\\ Form\\ FormEvents ` class.
228
243
Additionally, each event callback (listener or subscriber method) is passed a
229
244
single argument, which is an instance of
230
245
:class: `Symfony\\ Component\\ Form\\ FormEvent `. The event object contains a
231
- reference to the current state of the form, and the current data being
246
+ reference to the current state of the form and the current data being
232
247
processed.
233
248
234
249
.. _component-form-event-table :
0 commit comments