Symfony2 global branch template generation

I use Symfony2.8, and when I use the command line to create controllers and twig templates, templates are created in

MyBundle/Resources/views/home/home.html.twig

I want to follow the recommendations of symfony docs and have it inside

app/Resources/views/home/home.html.twig

I could just cut and paste the twig file, and then change {% extends %} if necessary, but then I would have less hair on my head because I would pull it out.

So, what should I enter at the prompt so that it generates a controller in MyBundle , as usual, but the twig files would be in the global folder app/Resources/views

Thanks!

Edit: new extended question

+5
source share
1 answer

After a small reproduction of the template generation path, I managed to place the twig file inside the application / Resources / Views / folder.

Assuming you have the standard symfony2 application architecture: You can write the following path for the template when the generator asks you to specify Templatename

 Templatename (optional) [AppBundle:Post:get.html.twig]: ::../../../../app/Resources/views/Post/get.html.twig 
+5
source

All Articles