Symfony2: how to override core template?

前端 未结 3 1259
心在旅途
心在旅途 2021-02-02 03:38

I am trying to override SymfonyGeneratorBundle templates by creating

\\app\\Resources\\SensioGeneratorBundle\\skeleton\\crud\\views\\index.html.twig
3条回答
  •  天命终不由人
    2021-02-02 04:19

    To override the edit template, for example, in 2.3+ version, copy the file:

    vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/crud/views/edit.html.twig.twig
    

    for the directory:

    app/Resources/SensioGeneratorBundle/skeleton/crud/views/edit.html.twig.twig
    

    Now, just generate crud with the default command and it will use the new template.

提交回复
热议问题