'Symfony Easyadmin - How to add a custom action near "btn action-new"?
I would like to add a custom action near " btn action-new" in list page. I try:
entities:
Pratiquant:
class: AppBundle/Entity/Pratiquant
actions:
- {name: 'fichePresence', type: 'method', action: 'fichePresence', label: 'fiche de presence' }
I don't need this:
entities:
Pratiquant:
class: AppBundle/Entity/Pratiquant
list:
actions:
- {name: 'fichePresence', type: 'method', action: 'fichePresence', label: 'fiche de presence' }
Hope someone understand me!
Solution 1:[1]
With EasyAdmin 3 :
public function configureActions(Actions $actions): Actions
{
$fichePresence = Action::new('fichePresence', 'fiche de presence', 'fa fa-download')
->linkToCrudAction('fichePresenceAction')
->createAsGlobalAction();
return $actions
->add(Crud::PAGE_INDEX, Action::DETAIL)
->add(Crud::PAGE_INDEX, $fichePresence);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Romaixn |
