Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 763 Bytes

File metadata and controls

26 lines (17 loc) · 763 Bytes

Embedded Relations for EasyAdminBundle

Based on a pull request by lukasluecke

EasyCorp/EasyAdminBundle#3543

Installation

I recommend that you don't. However:

composer require madforit/easyadmin-embed-bundle

Usage

Change your CRUD controller to extend Madforit\EasyAdminEmbedBundle\Controller\AbstractCrudController

class MyCrudController extends \Madforit\EasyAdminEmbedBundle\Controller\AbstractCrudController {
    
    public function configureFields(string $pageName): iterable {
        // Unfortunately you have to specify the template here
        yield EmbedField::new('relation_field')->setTemplatePath('@EasyAdminEmbed/crud/field/embed.html.twig')
    }
}