8000 [Webprofiler] Added blocks that allows extension of the profiler page. by Nyholm · Pull Request #23680 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Webprofiler] Added blocks that allows extension of the profiler page. #23680

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

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@

<h2>Translation Messages</h2>

{% block before_translation_messages %}{% endblock %}
Copy link
Member

Choose a reason for hiding this comment

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

Instead of before/after blocks, I would prefer one block that wraps all the content, which can then be overridden easily with:

{% block contents %}
  before
  {{ parent() }}
  after
{% endblock %}

Copy link
Member Author

Choose a reason for hiding this comment

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

Great suggestion. Thank you


{# sort translation messages in groups #}
{% set messages_defined, messages_missing, messages_fallback = [], [], [] %}
{% for message in collector.messages %}
Expand All @@ -108,7 +110,9 @@
<p>None of A952 the used translation messages are defined for the given locale.</p>
</div>
{% else %}
{{ helper.render_table(messages_defined) }}
{% block defined_messages %}
{{ helper.render_table(messages_defined) }}
{% endblock %}
{% endif %}
</div>
</div>
Expand All @@ -127,7 +131,9 @@
<p>No fallback translation messages were used.</p>
</div>
{% else %}
{{ helper.render_table(messages_fallback) }}
{% block fallback_messages %}
{{ helper.render_table(messages_fallback) }}
{% endblock %}
{% endif %}
</div>
</div>
Expand All @@ -147,11 +153,16 @@
<p>There are no messages of this category.</p>
</div>
{% else %}
{{ helper.render_table(messages_missing) }}
{% block missing_messages %}
{{ helper.render_table(messages_missing) }}
{% endblock %}
{% endif %}
</div>
</div>
</div>

{% block after_translation_messages %}{% endblock %}

{% endblock %}

{% macro render_table(messages) %}
Expand Down
0