From b5016a2b6c62312b4c0c9249ef97d034fc3cf3fd Mon Sep 17 00:00:00 2001 From: Darien Hager Date: Tue, 24 Mar 2015 18:20:03 -0700 Subject: [PATCH 1/3] Flesh out twig-template for custom data-collector --- cookbook/profiler/data_collector.rst | 44 +++++++++++++++++++++------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/cookbook/profiler/data_collector.rst b/cookbook/profiler/data_collector.rst index db3a86bfdab..f4d98e05a4b 100644 --- a/cookbook/profiler/data_collector.rst +++ b/cookbook/profiler/data_collector.rst @@ -106,27 +106,51 @@ Adding Web Profiler Templates ----------------------------- When you want to display the data collected by your data collector in the web -debug toolbar or the web profiler, create a Twig template following this -skeleton: +debug toolbar or the web profiler, you will need to create a Twig template. The +following example can help you get started: .. code-block:: jinja {% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - + {% block toolbar %} - {# the web debug toolbar content #} + {# Used for the menu items along the bottom of the screen. #} + {% set icon %} + + Example + {% endset %} + + {% set text %} +
+ Quick roll-over + info here +
+ {% endset %} + + {# Omit this next line if you do not have a "panel" section #} + {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': true } %} + {% endblock %} - + {% block head %} - {# if the web profiler panel needs some specific JS or CSS files #} + {# Optional, if you need your own JS or CSS files. #} + {{ parent() }} {# Use parent() to keep the default styles #} {% endblock %} - + {% block menu %} - {# the menu content #} + {# The left-hand menu content when looking at profiler data. #} + + + Example Collector + {% endblock %} - + {% block panel %} - {# the panel content #} + {# Optional, for showing the most details. #} +

Example

+

+ Major information goes here +

{% endblock %} Each block is optional. The ``toolbar`` block is used for the web debug From f3a436f663096e42d807d5c5feeb7dc02c83f992 Mon Sep 17 00:00:00 2001 From: Darien Hager Date: Wed, 25 Mar 2015 10:37:13 -0700 Subject: [PATCH 2/3] Fix incorrect instructions regarding linking to the "full panel", improve roll-over data example. --- cookbook/profiler/data_collector.rst | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cookbook/profiler/data_collector.rst b/cookbook/profiler/data_collector.rst index f4d98e05a4b..ebe58a8f2e7 100644 --- a/cookbook/profiler/data_collector.rst +++ b/cookbook/profiler/data_collector.rst @@ -114,7 +114,7 @@ following example can help you get started: {% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} {% block toolbar %} - {# Used for the menu items along the bottom of the screen. #} + {# This toolbar item may appear along the top or bottom of the screen.#} {% set icon %} Example @@ -122,12 +122,17 @@ following example can help you get started: {% set text %}
- Quick roll-over - info here + Quick piece of data + 100 units
+ +
+ Another quick thing + 300 units
{% endset %} - {# Omit this next line if you do not have a "panel" section #} + {# Set the "link" value to false if you do not have a big "panel" + section that you want to direct the user to. #} {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': true } %} {% endblock %} @@ -138,7 +143,7 @@ following example can help you get started: {% endblock %} {% block menu %} - {# The left-hand menu content when looking at profiler data. #} + {# This left-hand menu appears when using the full-screen profiler. #} Example Collector From f9910a9f15f7651560a0ab06dcae27f637ad571c Mon Sep 17 00:00:00 2001 From: Darien Hager Date: Wed, 25 Mar 2015 10:37:47 -0700 Subject: [PATCH 3/3] Remove indentations for all-whitespace lines. --- cookbook/profiler/data_collector.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cookbook/profiler/data_collector.rst b/cookbook/profiler/data_collector.rst index ebe58a8f2e7..233b36a4f16 100644 --- a/cookbook/profiler/data_collector.rst +++ b/cookbook/profiler/data_collector.rst @@ -112,14 +112,14 @@ following example can help you get started: .. code-block:: jinja {% extends 'WebProfilerBundle:Profiler:layout.html.twig' %} - + {% block toolbar %} {# This toolbar item may appear along the top or bottom of the screen.#} {% set icon %} Example {% endset %} - + {% set text %}
Quick piece of data @@ -130,18 +130,18 @@ following example can help you get started: 300 units
{% endset %} - + {# Set the "link" value to false if you do not have a big "panel" section that you want to direct the user to. #} {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': true } %} - + {% endblock %} - + {% block head %} {# Optional, if you need your own JS or CSS files. #} {{ parent() }} {# Use parent() to keep the default styles #} {% endblock %} - + {% block menu %} {# This left-hand menu appears when using the full-screen profiler. #} @@ -149,7 +149,7 @@ following example can help you get started: Example Collector {% endblock %} - + {% block panel %} {# Optional, for showing the most details. #}

Example