-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBridge] Added template "name" argument to debug:twig command to find their paths #27981
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
Conversation
e6892ba
to
d541670
Compare
b749b99
to
3d246a8
Compare
Should it be a dedicated command or an option on the |
IMHO the At first I thought about adding it to I'd also like to have everything in one command, but its initial design should change then. I imagine something like this: $ b/c debug:twig # show general info
# proposal 1 (without refactor)
$ b/c debug:twig escape # filter the general info
$ b/c debug:twig --find=@Twig/Exception/error.html.twig # find the template path
# proposal 2 (with refactor) much better to me.
$ b/c debug:twig @Twig/Exception/error.html.twig # find the template path
$ b/c debug:twig --filter=escape # filter the general info Do you prefer this? |
cbb48c5
to
628e66c
Compare
628e66c
to
2216514
Compare
@nicolas-grekas I added a second commit with your suggestion and MINOR FEATURE:
|
26b9e60
to
642313c
Compare
Fixing AppVeyor failure... Status: Needs Work |
2fb0110
to
7c26264
Compare
(Travis failures unrelated) Status: Needs Review |
Status: Needs Review |
…o find their paths
c3a9eb1
to
7ef3d39
Compare
Thank you @yceruto. |
…wig command to find their paths (yceruto) This PR was squashed before being merged into the 4.2-dev branch (closes #27981). Discussion ---------- [TwigBridge] Added template "name" argument to debug:twig command to find their paths | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27911 | License | MIT | Doc PR | symfony/symfony-docs#10232 Find the template file (to load by Twig) from a given template name (useful to know which file will be loaded exactly and which ones don't):  This will also show the overridden files if they exist and the paths corresponding to their namespace. In addition, the command suggests alternatives if you made a typo (this way you can check your template name quickly): | namespace typo | template name typo | | --- | --- | |  |  | <details> <summary><strong>Other outputs</strong></summary> Discovering more alternatives:  Unknown template name:  </details> ## Update The feature was introduced into `debug:twig` command and the `filter` argument was converted to `--filter` option. The `name` argument is now the first one of the command. Commits ------- 7ef3d39 [TwigBridge] Added template \"name\" argument to debug:twig command to find their paths
This PR was merged into the master branch. Discussion ---------- Documenting debug:twig command See symfony/symfony#27981 Commits ------- 1026020 Documenting debug:twig command
Find the template file (to load by Twig) from a given template name (useful to know which file will be loaded exactly and which ones don't):

This will also show the overridden files if they exist and the paths corresponding to their namespace.
In addition, the command suggests alternatives if you made a typo (this way you can check your template name quickly):
Other outputs
Discovering more alternatives:

Unknown template name:

Update
The feature was introduced into
debug:twig
command and thefilter
argument was converted to--filter
option. Thename
argument is now the first one of the command.