Created
November 4, 2013 13:20
-
-
Save dbu/7302316 to your computer and use it in GitHub Desktop.
extend edit template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% block form %} | |
{% set url = admin.id(object) is not null ? 'edit' : 'create' %} | |
{% if not admin.hasRoute(url)%} | |
<div> | |
{{ "form_not_available"|trans({}, "SonataAdminBundle") }} | |
</div> | |
{% else %} | |
<form class="form-horizontal" | |
action="{{ admin.generateUrl(url, {'id': admin.id(object), 'uniqid': admin.uniqid, 'subclass': app.request.get('subclass')}) }}" {{ form_enctype(form) }} | |
method="POST" | |
{% if not admin_pool.getOption('html5_validate') %}novalidate="novalidate"{% endif %} | |
> | |
{% if form.vars.errors|length > 0 %} | |
<div class="sonata-ba-form-error"> | |
{{ form_errors(form) }} | |
</div> | |
{% endif %} | |
{% include "LiipchCoreBundle:Form:header_item.html.twig" with {"header_item_name": "item", "header_item": form, "id": admin.uniqid } %} | |
{{ form_rest(form) }} | |
{{ block('formactions') }} | |
</form> | |
{% endif%} | |
{% endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment