I want to put it in the SRC directory.
Reply content:
I want to put it in the SRC directory.
About the location of template files
The template file is placed in the SRC directory for only one reason: your template file belongs to "reusable bundle (Reusable bundle)"!
If this is the case, such as the Bundle name is Acmeblogbundle, then the location of the template file is usually "Src/acme/bundle/blogbundle/resources/views". But the premise of this is that your bundles are reusable and can be used directly on other projects.
If this is not the case (usually not, unless you are developing a third-party bundle, such as Fosuserbundle), then the template file is placed under "App/resource/views" Conforms to Symfony's practice (Convention) and recommended .
About Bundles
Best Practice
Create One bundle called Appbundle for your application logic
As above (from Symfony official documents), Symfony's official best practices recommend an app that only needs to create a bundle(Appbundle) is enough. In fact, when you create an app with the Symfony command, the bundle is already built.
How can I tell if I need to create a bundle?
When you have multiple projects that can use the same application logic (Domain logic), you can abstract this set of application logic as a separate bundle of bundles.
The application logic of the independent bundle can not rely on other bundles, otherwise it is not a separate bundle.
When you create a standalone (reusable) bundle, nature, including its associated templates, configuration files, and so on, can be placed under its own file structure.
Refer to the file structure of the standalone (reusable) bundle as follows (from Symfony official website document)
/├─ AcmeBlogBundle.php├─ Controller/├─ README.md├─ LICENSE├─ Resources/│ ├─ config/│ ├─ doc/│ │ └─ index.rst│ ├─ translations/│ ├─ views/│ └─ public/└─ Tests/
Finally, attach the link URL of symfony about best practice
Symfony Best Practices
Best Practices for Reusable Bundles