EasyAdmin: Specifying a page in CrudController

1.1k views Asked by At

How can I give my Crud controller a specific template?

For example, I have the user entity linked to its controller UserCrudController.

I want the creation page to be another page than the one provided by EasyAdmin by default (templates/user/new.html.twig).

How do I specify this in the CrudController ?

1

There are 1 answers

0
Alexandru Burca On BEST ANSWER

Use overrideTemplate. Example

public function configureCrud(Crud $crud): Crud
    {
        return $crud
            // ...
            ->overrideTemplate('crud/layout', 'admin/layout.html.twig')
        ;
    }