EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

add possibility to use route parameters on crud actions

Open CodinKitchen opened this issue 3 years ago • 0 comments

I made this contribution to allow passing route parameters when creating custom actions using linkToCrudAction. Usage is similar to linkToRoute, passing parameters either as array or callable as second method parameter.

Usage example :

$viewInvoice = Action::new('viewInvoice', 'Invoice', 'fa fa-file-invoice')
    ->linkToCrudAction('renderInvoice', ['type' => 'pdf']);

The idea is to allow reuse of methods for multiple actions. In my case I have a method wich does apply a Symfony Workflow transition and I wanted to be able to add transition name as parameter instead of of writing a different method for each transition.

CodinKitchen avatar Mar 28 '22 12:03 CodinKitchen