فهرست منبع

added a condition for 'add new' button to only display when you edit an entity and no longer display on the create form

sjopet 13 سال پیش
والد
کامیت
0f612d376d
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      Resources/views/CRUD/base_edit.html.twig

+ 1 - 1
Resources/views/CRUD/base_edit.html.twig

@@ -28,7 +28,7 @@ file that was distributed with this source code.
             {% if admin.hasroute('history') and admin.id(object) and admin.isGranted('EDIT', object) %}
                 <li class="btn sonata-action-element"><a href="{{ admin.generateObjectUrl('history', object) }}">{% trans from 'SonataAdminBundle' %}link_action_history{% endtrans %}</a></li>
             {% endif %}
-            {% if admin.hasroute('create') and admin.isGranted('CREATE')%}
+            {% if admin.hasroute('create') and admin.isGranted('CREATE') and admin.id(object)%}
                 <li class="btn sonata-action-element"><a href="{{ admin.generateUrl('create') }}">{% trans from 'SonataAdminBundle' %}link_action_create{% endtrans %}</a></li>
             {% endif %}
             {% if admin.hasroute('list') and admin.isGranted('LIST')%}