mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
Add passing form to the form-related hooks to make sure the form_theme is applied
This commit is contained in:
parent
bad4d6353f
commit
a4ced77ac5
4 changed files with 5 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
{% if form is not defined %}
|
||||
{% set form = hookable_metadata.context.form %}
|
||||
{% endif %}
|
||||
|
||||
{% form_theme form '@SyliusAdmin/Shared/form_theme.html.twig' %}
|
||||
|
||||
<div class="container-xl">
|
||||
|
|
@ -12,7 +13,7 @@
|
|||
{{ form_errors(form, sylius_test_form_attribute('form-validation-errors')) }}
|
||||
{{ form_widget(form._token) }}
|
||||
|
||||
{% hook 'form' %}
|
||||
{% hook 'form' with { form } %}
|
||||
</div>
|
||||
{{ form_end(form, {render_rest: hookable.configuration.render_rest|default(false)}) }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
{% form_theme form '@SyliusAdmin/Shared/form_theme.html.twig' %}
|
||||
|
||||
{{ form_start(form, {'action': path('sylius_admin_login_check'), 'attr': {'class': 'ui large loadable form', 'novalidate': 'novalidate'}}) }}
|
||||
{% hook 'form' %}
|
||||
{% hook 'form' with { form } %}
|
||||
<input type="hidden" name="_csrf_admin_security_token" value="{{ csrf_token('admin_authenticate') }}">
|
||||
{{ form_end(form, {'render_rest': false}) }}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
{% endif %}
|
||||
{{ form_start(form, {'action': path(configuration.vars.route.name|default(configuration.getRouteName('create')), configuration.vars.route.parameters|default({})), 'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate', 'id': form.vars.id}}) }}
|
||||
{% block form_content %}
|
||||
{% hook 'form' %}
|
||||
{% hook 'form' with { form } %}
|
||||
{% endblock %}
|
||||
{{ form_end(form, {'render_rest': renderRest}) }}
|
||||
{% if renderRest %}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
{% block form_content %}
|
||||
<input type="hidden" name="_method" value="PUT"/>
|
||||
|
||||
{% hook 'form' %}
|
||||
{% hook 'form' with { form } %}
|
||||
{% endblock %}
|
||||
{{ form_end(form, {'render_rest': renderRest}) }}
|
||||
{% if renderRest %}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue