0

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 ?

Mike Doe
  • 16,349
  • 11
  • 65
  • 88
nemoxi
  • 530
  • 1
  • 7
  • 23

1 Answers1

1

Use overrideTemplate. Example

public function configureCrud(Crud $crud): Crud
    {
        return $crud
            // ...
            ->overrideTemplate('crud/layout', 'admin/layout.html.twig')
        ;
    }
Alexandru Burca
  • 427
  • 1
  • 4
  • 15