Skip to content

Commit

Permalink
feature #23680 [Webprofiler] Added blocks that allows extension of th…
Browse files Browse the repository at this point in the history
…e profiler page. (Nyholm)

This PR was squashed before being merged into the 3.4 branch (closes #23680).

Discussion
----------

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

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (to be retargeted)
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Im not sure if we allow this but I thought I would try to submit this PR.
The [TranslationBundle](https://github.com/php-translation/symfony-bundle) is extending the Symfony profiler page for translation. It would be great if it didn't have to replace all the contents but just replace some smaller blocks.

Commits
-------

ffd25fb [Webprofiler] Added blocks that allows extension of the profiler page.
  • Loading branch information
fabpot committed Aug 22, 2017
2 parents cf1ff43 + ffd25fb commit 3946812
Showing 1 changed file with 14 additions and 3 deletions.
Expand Up @@ -82,6 +82,8 @@

<h2>Translation Messages</h2>

{% block messages %}

{# 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 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>

{% endblock messages %}

{% endblock %}

{% macro render_table(messages) %}
Expand Down

0 comments on commit 3946812

Please sign in to comment.