@@ -106,27 +106,51 @@ Adding Web Profiler Templates
106
106
-----------------------------
107
107
108
108
When you want to display the data collected by your data collector in the web
109
- debug toolbar or the web profiler, create a Twig template following this
110
- skeleton :
109
+ debug toolbar or the web profiler, you will need to create a Twig template. The
110
+ following example can help you get started :
111
111
112
112
.. code-block :: jinja
113
113
114
114
{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %}
115
-
115
+
116
116
{% block toolbar %}
117
- {# the web debug toolbar content #}
117
+ {# Used for the menu items along the bottom of the screen. #}
118
+ {% set icon %}
119
+ <span class="icon"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAcCAQAAADVGmdYAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQffAxkBCDStonIVAAAAGXRFWHRDb21tZW50AENyZWF0ZWQgd2l0aCBHSU1QV4EOFwAAAHpJREFUOMtj3PWfgXRAuqZd/5nIsIdhVBPFmgqIjCuYOrJsYtz1fxuUOYER2TQID8afwIiQ8YIkI4TzCv5D2AgaWSuExJKMIDbA7EEVhQEWXJ6FKUY4D48m7HYU/EcWZ8JlE6qfMELPDcUJuEMPxvYazYTDWRMjOcUyAEswO+VjeQQaAAAAAElFTkSuQmCC" alt=""/></span>
120
+ <span class="sf-toolbar-status">Example</span>
121
+ {% endset %}
122
+
123
+ {% set text %}
124
+ <div class="sf-toolbar-info-piece">
125
+ <b>Quick roll-over</b>
126
+ <b>info here</b>
127
+ </div>
128
+ {% endset %}
129
+
130
+ {# Omit this next line if you do not have a "panel" section #}
131
+ {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': true } %}
132
+
118
133
{% endblock %}
119
-
134
+
120
135
{% block head %}
121
- {# if the web profiler panel needs some specific JS or CSS files #}
136
+ {# Optional, if you need your own JS or CSS files. #}
137
+ {{ parent() }} {# Use parent() to keep the default styles #}
122
138
{% endblock %}
123
-
139
+
124
140
{% block menu %}
125
- {# the menu content #}
141
+ {# The left-hand menu content when looking at profiler data. #}
142
+ <span class="label">
143
+ <span class="icon"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAcCAQAAADVGmdYAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQffAxkBCDStonIVAAAAGXRFWHRDb21tZW50AENyZWF0ZWQgd2l0aCBHSU1QV4EOFwAAAHpJREFUOMtj3PWfgXRAuqZd/5nIsIdhVBPFmgqIjCuYOrJsYtz1fxuUOYER2TQID8afwIiQ8YIkI4TzCv5D2AgaWSuExJKMIDbA7EEVhQEWXJ6FKUY4D48m7HYU/EcWZ8JlE6qfMELPDcUJuEMPxvYazYTDWRMjOcUyAEswO+VjeQQaAAAAAElFTkSuQmCC" alt=""/></span>
144
+ <strong>Example Collector</strong>
145
+ </span>
126
146
{% endblock %}
127
-
147
+
128
148
{% block panel %}
129
- {# the panel content #}
149
+ {# Optional, for showing the most details. #}
150
+ <h2>Example</h2>
151
+ <p>
152
+ <em>Major information goes here</em>
153
+ </p>
130
154
{% endblock %}
131
155
132
156
Each block is optional. The ``toolbar `` block is used for the web debug
0 commit comments