Skip to content

Commit

Permalink
minor #5996 Clarify example for SUBMIT form event (bkosborne)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Clarify example for SUBMIT form event

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3+
| Fixed tickets | #5990

It's indicated in the docs that form field cannot be added/removed by listeners of the SUBMIT form event, but the example provided was removing fields. While it's possible to do so, it's not recommended since it has little effect. Replaced with a different example implementation.

Commits
-------

4794492 Clarify example for SUBMIT form event
  • Loading branch information
wouterj committed Dec 12, 2015
2 parents f0e8e88 + 4794492 commit 92c39c6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions components/form/form_events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,9 @@ View data Same as in ``FormEvents::POST_SET_DATA``

.. sidebar:: ``FormEvents::SUBMIT`` in the Form component

The ``Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener``
subscribes to the ``FormEvents::SUBMIT`` event in order to remove the
fields that need to be removed whenever manipulating a collection of forms
for which ``allow_delete`` has been enabled.
The ``Symfony\Component\Form\Extension\Core\EventListener\FixUrlProtocolListener``
subscribes to the ``FormEvents::SUBMIT`` event in order to prepend a default
protocol to URL field data that was submitted without a protocol.

C) The ``FormEvents::POST_SUBMIT`` Event
........................................
Expand Down

0 comments on commit 92c39c6

Please sign in to comment.