-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[RFC] Introduce new template namespaces for bundles #11051
Copy link
Copy link
Closed
Labels
DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)FrameworkBundleRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)
Metadata
Metadata
Assignees
Labels
DXDX = Developer eXperience (anything that improves the experience of using Symfony)DX = Developer eXperience (anything that improves the experience of using Symfony)FrameworkBundleRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)
Type
Fields
Give feedbackNo fields configured for issues without a type.
(this issue is part of the "DX" ("Developer eXperience") initiative introduced by Symfony project)
On the symfony-docs repository there is a very long discussion about the new template naming syntax.
In short, some people think that the old syntax has inconsistencies in cases like the following:
@AcmeBlogBundle/Resources/views/Default/common/template4.html.twigAcmeBlogBundle : Default : common / template4.html.twigAcmeBlogBundle : Default / common : template4.html.twigUsing the new namespaced Twig syntax, the template name would always be:
@AcmeBlog/Default/common/template4.html.twigRemoving the
Resources/views/part is very common and easy to understand. But removing theBundlesuffix is really strange and inconsistent with the rest of Symfony.This problem is introduced in lines 136-138 of TwigBundle/DependencyInjection/TwigExtension.php file.
Summarized Proposals
Deprecate the current behavior (0) and choose one of the following to implement and recommend:
AcmeBlogBundle:Default:index.html.twig@AcmeBlogBundle/Default/index.html.twigResources/views@AcmeBlogBundle:Default/index.html.twigResources/viewsAcmeBlogBundle:Default/index.html.twigResources/views@AcmeBlogBundle:views/Default/index.html.twigResources, could also be used consistent with routing importsAcmeBlogBundle:views/Default/index.html.twigResourcesview@AcmeDemoBundle/Default/index.html.twigpublic@,config@that could be used elsewhere