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