{% extends "DI/base.html.twig" %} {% block title %} Object Edition {% endblock %} {% block head %} {% endblock %} {% block actions %} {% endblock %} {% block toasts %} {# database information toast #} {% endblock %} {% block body %} {# inject form #}
{{ form(form, {'attr': {'id' : 'object_form'}}) }}
{% endblock %} {% block ready_scripts %} {# Widget #} const oWidget = new Widget(); oWidget.handleElement(document); {# Form #} const oForm = new Form(oWidget); oForm.handleElement(document); {# Collection #} const oCollection = new Collection(oForm, '{{ path('object_form', {'class': 'object_class', 'id' : 0, 'name': 'form_name'}) }}'); oCollection.handleElement(document); {# toast database information #} const toastLiveExample = document.getElementById('toast') const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastLiveExample) toastBootstrap.show(); {% endblock %}