Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Templating Naming Pattern #6561

Merged
merged 1 commit into from
May 13, 2016
Merged

About Templating Naming Pattern #6561

merged 1 commit into from
May 13, 2016

Conversation

raulconti
Copy link
Contributor

Q A
Doc fix? yes
New docs? no
Applies to all
Fixed tickets

If I'm not wrong, the correct way to use the namespaced syntax is omitting the word "Bundle".

This work for me:
@App/Hello/index.html.twig

However this doesn't:
@AppBundle/Hello/index.html.twig

@linaori
Copy link
Contributor

linaori commented May 12, 2016

I'm not entirely sure about this; my rendering goes as following: @Template("AppBundle:Invoice:create_credit.html.twig"). App would only be valid if your AppBundle is called App. I don't see my app using @App or @AppBundle when rendering templates though, but maybe both are supported.

@javiereguiluz
Copy link
Member

@raulconti you are right. These lines of code are the ones that strip the Bundle suffix in Twig namespaces. @iltar you are right too. When using the old template naming you can't remove the Bundle suffix.

By the way, I hate this inconsistency and I think Twig namespaces shouldn't change anything.

@wouterj
Copy link
Member

wouterj commented May 13, 2016

You're correct, Raúl. Thanks!

@wouterj wouterj merged commit 8b7efb0 into symfony:2.3 May 13, 2016
wouterj added a commit that referenced this pull request May 13, 2016
This PR was merged into the 2.3 branch.

Discussion
----------

About Templating Naming Pattern

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets |

If I'm not wrong, the correct way to use the namespaced syntax is omitting the word "Bundle".

This work for me:
`@App/Hello/index.html.twig`

However this doesn't:
`@AppBundle/Hello/index.html.twig`

Commits
-------

8b7efb0 fixing special shortcut syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants