删除在简易表单管理捆绑包中不起作用的实体

时间:2018-11-15 07:31:58

标签: php symfony-2.1 symfony-2.7 symfony2-easyadmin easyadmin

我有此代码:

{{ form_start(form, {'attr': {'class': 'form-vertical edit-form', 'id': 'new-users-form', 'data-view': 'new'}}) }}
<div class="row">
    <div class="field-group col-xs-12 col-sm-4">
        <div class="box box-default">
            <div class="box-body " id="box-body-_easyadmin_form_design_element_0">
                <div class="row">
                    <div class="col-xs-12 ">
                        <div class="form-group field-text">
                            {{ form_row(form.value, {'attr': {'class': 'form-control' }}) }}
                        </div>
                    </div>
                    <div class="col-xs-12 ">
                        <div class="form-group field-text">
                            {{ form_row(form.comment, {'attr': {'class': 'form-control' }}) }}
                        </div>
                    </div>
                    <div class="col-xs-12 form-actions">
                        <div class="form-group">
                            <div id="form-actions-row">
                                <button type="submit" class="btn btn-primary action-save pull-right">
                                    <i class="fa fa-check"></i> {{ 'general.buttons.confirm'|trans }}
                                </button>
                                <a class="btn btn-danger pull-right action-delete" style="margin-right: 1%" title=""
                                   href="{{ path('admin', {'entity' : 'User', 'action' : 'delete', 'id' : entity.id}) }}" target="_self">
                                    <i class="fa fa-trash-o"></i>
                                    {{ 'general.buttons.delete'|trans }}
                                </a>
                                <a name="list" class="btn btn-secondary pull-right" title=""
                                   href="{{ path('admin', {'entity' : 'User', 'action' : 'list'}) }}" target="_self">
                                    {{ 'general.buttons.back_to_liste'|trans }}
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{{ form_widget(form._token) }}
{{ form_end(form,{'render_rest': false}) }}

添加和返回链接正常工作。唯一的问题是删除按钮。当我尝试删除时,我将重定向到用户实体列表,删除当前用户。我没有任何错误。请帮我。提前谢谢

0 个答案:

没有答案