how can we override sonata bundle layout for a single Admin class like i have created 3 Admin Class userAdmin, productAdmin, ticketAdmin now i want to override ticketAdmin edit action and edit template and add some extra code there.
You can use :
Controller :
custom action in SonataAdminBundle
Template :
// in your admin class
public function getTemplate($name)
{
switch ($name) {
case 'edit':
return 'AcmeMyBundle::my-custom-edit.html.twig';
break;
default:
return parent::getTemplate($name);
break;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With