Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting multiple dynamic forms on the same page #363

Open
wants to merge 1 commit into
base: 2.5
Choose a base branch
from

Conversation

dev-newvisibility
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? no
License MIT

What's in this PR?

This PR replaces the URL parameter send=true that is added when a form is submitted with send=<form-id>

Why?

At the moment, if you add multiple dynamic forms to the same template, or if multiple forms are displayed on the same page, you can't know which one has been submitted due to the fact that the send URL parameter value is the same for all forms.

Example Usage

{% if app.request.get('send') != view.form.entity.formId %}
  {# FORM THEME #}
  {% form_theme content.form '@SuluForm/themes/basic.html.twig' %}
  {{ form(content.form) }}
{% else %}
  {{ view.form.entity.successText|raw }}
{% endif %}

BC Breaks/Deprecations

Templates must be updated

@dev-newvisibility dev-newvisibility changed the title Supporting multiple dynamic forms in the same page Supporting multiple dynamic forms on the same page Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant