base_edit.twig 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {#
  2. This file is part of the Sonata package.
  3. (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  4. For the full copyright and license information, please view the LICENSE
  5. file that was distributed with this source code.
  6. #}
  7. {% block title %}
  8. {% if object.id %}
  9. <h1>Edit</h1>
  10. {% else %}
  11. <h1>Create</h1>
  12. {% endif %}
  13. {% endblock %}
  14. {% block actions %}
  15. <div>
  16. <ul>
  17. <li><a href="{{ url(urls.create.url) }}">{% trans "link_action_create" from "BaseApplicationBundle" %}</a></li>
  18. <li><a href="{{ url(urls.list.url) }}">{% trans "link_action_list" from "BaseApplicationBundle" %}</a></li>
  19. </ul>
  20. </div>
  21. {% endblock %}
  22. {% block form %}
  23. <form action="{{ url(urls.update.url, {'id': object.id}) }}" method="POST">
  24. {{ form|render_hidden }}
  25. {% for field in fields %}
  26. {{ field|render_form_element(form, object, {'urls' : urls}) }}
  27. {% endfor %}
  28. {% if object.id %}
  29. <input type="submit" value="{% trans "btn_update" from "BaseApplicationBundle" %}"/>
  30. {% else %}
  31. <input type="submit" value="{% trans "btn_create" from "BaseApplicationBundle" %}"/>
  32. {% endif %}
  33. </form>
  34. {% endblock %}