Fields
Actions
Docs
Under the hood
Fields
Actions
This page explains the inner workings of DreamForm. Some of this stuff might be useful to you, if you're extending DreamForm with custom guards, fields or actions. It's also not complete. Let me know if there's anything missing that might be useful to know.
Lifecycle of a form submission
- The form page is resolved, e.g. from a field.
- The form template accesses the submission from the session data, if available.
- The form is rendered in the template, either using the default snippet or a custom one.
- The user fills out the form and submits it.
- The submission page is created (virtually).
dreamform.submit:before
hook is called.- The guards are checked.
- The form fields are validated.
- If the form validation was successful & the form is at the last stage, the form actions are executed.
dreamform.submit:after
hook is called - even if the form submission is uncomplete (multi-step form).- The form submission is saved as page if the submission has been successful so far.
- The fields
afterSubmit
methods are called (used for file uploads). - The form submission is saved as session data.