如何在SonataAdminBundle中设置Admin类,以显示在模态窗口中添加/编辑实体的表单?如下所示:
手动你可以自己做。
calls:
- [ setTemplate, [list, AcmeYourBundle:Your:base_list.html.twig]]
- [ setTemplate, [edit, AcmeYourBundle:Your:base_edit.html.twig]]
protected function configureListFields(ListMapper $listMapper) {
$listMapper
->add('_action', 'actions', array(
'actions' => array(
'edit' => array('template' => 'AcmeYourBundle:Your:_action_edit.html.twig'),
)
));
}
{% if admin.hasRoute('edit') and admin.id(object) and admin.isGranted('EDIT', object)%}
<a class="edit sonata-action-element" href="{{ admin.generateObjectUrl('edit', object) }}">
<i class="fa fa-edit"></i>
{{ 'link_action_edit'|trans({}, 'SonataAdminBundle') }}
</a>
{% endif %}
目前尚不支持此功能,这是一项计划功能,但目前尚无ETA功能。