8000 [HackDay][WebProfilerBundle]Display the main template on the debug toolbar by vincentmoulene · Pull Request #29534 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HackDay][WebProfilerBundle]Display the main template on the debug toolbar #29534

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

vincentmoulene
Copy link
Contributor
@vincentmoulene vincentmoulene commented Dec 8, 2018
Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #
License MIT
Doc PR None

It's my first PR for the Symfony community.
I thought it would be useful to display the main template in the debug toolbar.
Eg :
capture d ecran 2018-12-08 a 16 16 48

Thanks for all and thanks for you feedbacks.

#SymfonyConHackday2018

Copy link
Contributor
@ro0NL ro0NL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im a bit worried the logic is hard to reason about, by assuming that it's always one "main" render call (return $this->render('main_template.html.twig')). Whereas technically we just show the first render call and call it the main one :} im not sure that's OK.

@@ -55,6 +55,12 @@
<span>{{ collector.route|default('n/a') }}</span>
</div>

{%- set keystemplates = profile.collectors['twig'].getTemplates|keys|default(false) -%}
Copy link
Contributor
@ro0NL ro0NL Dec 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this creates a dependency with the twig collector which can break, to me that implies it belongs in the twig toolbar block at least (or should be checked for; i can see you want to have it here actually).

@jvasseur
Copy link
Contributor
jvasseur commented Dec 8, 2018

I agree with @ro0NL here, the first call to render is not necessary the main template, one example is when you first render an template to send an email and then send a response.

@nicholasruunu
Copy link
Contributor

Really good idea, would save me time. 👍

@ro0NL
Copy link
Contributor
ro0NL commented Dec 8, 2018

Also see a related past discussion on the topic: #24236 (comment) / #24236 (review)

And perhaps more ultimately: #28056

@fabpot
Copy link
Member
fabpot commented Dec 8, 2018

It was not done before for the reasons explained by others: there is not a "main" template concept in Symfony. And the first one might not be the "main" one. I suggest to close as having a feature that does not work for all use cases is not something we want in core.

@chalasr chalasr added this to the next milestone Dec 9, 2018
@fabpot fabpot closed this Dec 10, 2018
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019
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.

8 participants
0