diff --git a/_images/components/form/general_flow.png b/_images/components/form/general_flow.png deleted file mode 100644 index 31650e52af6..00000000000 Binary files a/_images/components/form/general_flow.png and /dev/null differ diff --git a/_images/components/form/set_data_flow.png b/_images/components/form/set_data_flow.png deleted file mode 100644 index 3cd4b1e2f7b..00000000000 Binary files a/_images/components/form/set_data_flow.png and /dev/null differ diff --git a/_images/components/form/submission_flow.png b/_images/components/form/submission_flow.png deleted file mode 100644 index a3c6e9cfb90..00000000000 Binary files a/_images/components/form/submission_flow.png and /dev/null differ diff --git a/_images/form/form_prepopulation_workflow.svg b/_images/form/form_prepopulation_workflow.svg new file mode 100644 index 00000000000..c44fa6b19e7 --- /dev/null +++ b/_images/form/form_prepopulation_workflow.svg @@ -0,0 +1,56 @@ + + + + + + + + New form + + + + + + Prepopulated form + + + + + + + + + + Model data + + + + + + POST_SET_DATA + + + + + + PRE_SET_DATA + + + + + + setData($data) + + + + + + + + + + normalization + + + + diff --git a/_images/form/form_submission_workflow.svg b/_images/form/form_submission_workflow.svg new file mode 100644 index 00000000000..e9ffc4043f7 --- /dev/null +++ b/_images/form/form_submission_workflow.svg @@ -0,0 +1,78 @@ + + + + + + + + denormalization + + + + + + normalization + + + + + + New form + + + + + + Prepopulated form + + + + + + Submitted form + + + + + + + + + + + + + + Request data + + + + + + handleRequest($request) + + + + + + + + + + PRE_SUBMIT + + + + + + SUBMIT + + + + + + POST_SUBMIT + + + + diff --git a/_images/form/form_workflow.svg b/_images/form/form_workflow.svg new file mode 100644 index 00000000000..432a7c51e47 --- /dev/null +++ b/_images/form/form_workflow.svg @@ -0,0 +1,68 @@ + + + + + + + + New form + + + + + + Prepopulated form + + + + + + Submitted form + + + + + + + + + + + + + + + + + + Model data + + + + + + Request data + + + + + + setData($data) + + + + + + handleRequest($request) + + + + + + + + + + + + diff --git a/_images/sources/form/form_events.dia b/_images/sources/form/form_events.dia new file mode 100644 index 00000000000..8e7afb1cb83 Binary files /dev/null and b/_images/sources/form/form_events.dia differ diff --git a/form/events.rst b/form/events.rst index 0f2e26e2775..a99698aa247 100644 --- a/form/events.rst +++ b/form/events.rst @@ -32,17 +32,16 @@ register an event listener to the ``FormEvents::PRE_SUBMIT`` event as follows:: The Form Workflow ----------------- -The Form Submission Workflow -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. raw:: html -.. image:: /_images/components/form/general_flow.png - :align: center + 1) Pre-populating the Form (``FormEvents::PRE_SET_DATA`` and ``FormEvents::POST_SET_DATA``) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. image:: /_images/components/form/set_data_flow.png - :align: center +.. raw:: html + + Two events are dispatched during pre-population of a form, when :method:`Form::setData() ` @@ -118,8 +117,9 @@ View data Normalized data transformed using a view transformer 2) Submitting a Form (``FormEvents::PRE_SUBMIT``, ``FormEvents::SUBMIT`` and ``FormEvents::POST_SUBMIT``) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. image:: /_images/components/form/submission_flow.png - :align: center +.. raw:: html + + Three events are dispatched when :method:`Form::handleRequest() `