mongodb - Custom action in the edit view of sonata admin Bundle -


i'm working sonata admin bundle , want add custom action in edit view ( update update , close or delete). searched, didn't find solution. did before in list view. have tried make same thing in case following answer sonataadmin custom form action not work , got error

could not load type "actions" when add

->add('_action', 'actions', array(         'actions' => array(             'view' => array('template' => 'atsadminbundle:crud:form__action_confirmation.html.twig')             )         ))     ; 

in

configureformfields()

any 1 can me plz ?

this because configureformfields() doesn't accept entry. can in configurelistfields().

if want add action in edit form, buttons: "update", "update , close" or "delete", have override following template:

vendor/sonata-project/admin-bundle/resources/views/crud/base_edit_form.html.twig

copy file in app/resources/sonataadminbundle/views/crud

and add action in {% block formactions %}, this:

{% if admin.hasroute('view') %}     <a class="btn btn-success" href="{{ admin.generateobjecturl('view', object) }}">view</a> {% endif %} 

this example point right direction. have adapt it.

good luck!


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -