EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

Add option to configure actions of FormField / Panel

Open lukasluecke opened this issue 5 years ago • 1 comments

Resolves #3519.

FormField::addPanel('Identität')
    ->configureActions(fn(Actions $actions) => $actions
        ->add(Crud::PAGE_DETAIL, Action::new('another', 'Another')->linkToUrl('...')->addCssClass('btn btn-secondary'))
        ->add(Crud::PAGE_DETAIL, Action::new('test', 'Test', 'fa fa-home')->linkToUrl('...')->addCssClass('btn btn-link'))
    )

CleanShot 2020-07-14 at 15 33 58@2x

lukasluecke avatar Jul 14 '20 13:07 lukasluecke

Nice feature!

Since this PR new methods were implemented: FormField::addRow and FormField::addTab, so I'm not sure if the it should be changed to:

FormField::addPanel(
    'Identität',
    null,
    fn(Actions $actions) => $actions->add(Crud::PAGE_DETAIL, Action::new('another', 'Another')->linkToUrl('...')->addCssClass('btn btn-secondary')))
;

Or how can we limit it to panels (excluding rows and tabs) in another way?

michaelKaefer avatar Aug 20 '22 13:08 michaelKaefer