EasyAdminBundle
EasyAdminBundle copied to clipboard
add possibility to use route parameters on crud actions
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.