File tree Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Original file line number Diff line number Diff line change @@ -136,3 +136,64 @@ DependencyInjection
136
136
<service id="foo" class="stdClass" shared="false" />
137
137
</services>
138
138
```
139
+
140
+ Web Development Toolbar
141
+ -----------------------
142
+
143
+ The web development toolbar has been completely redesigned. This update has
144
+ introduced some changes in the HTML markup of the toolbar items.
145
+
146
+ Before:
147
+
148
+ Information was wrapped with simple ` <span> ` elements:
149
+
150
+ ``` twig
151
+ {% block toolbar %}
152
+ {% set icon %}
153
+ <span>
154
+ <svg ...></svg>
155
+ <span>{{ '%.1f'|format(collector.memory / 1024 / 1024) }} MB</span>
156
+ </span>
157
+ {% endset %}
158
+ {% endblock %}
159
+ ```
160
+
161
+ After:
162
+
163
+ Information is now semantically divided into values and labels according to
164
+ the ` class ` attribute of each ` <span> ` element:
165
+
166
+ ``` twig
167
+ {% block toolbar %}
168
+ {% set icon %}
169
+ <svg ...></svg>
170
+ <span class="sf-toolbar-value">
171
+ {{ '%.1f'|format(collector.memory / 1024 / 1024) }}
172
+ </span>
173
+ <span class="sf-toolbar-label">MB</span>
174
+ {% endset %}
175
+ {% endblock %}
176
+ ```
177
+
178
+ Most of the blocks designed for the previous toolbar will still be displayed
179
+ correctly. However, if you want to support both the old and the new toolbar,
180
+ it's better to make use of the new ` profiler_markup_version ` variable passed
181
+ to the toolbar templates:
182
+
183
+ ``` twig
184
+ {% block toolbar %}
185
+ {% set profiler_markup_version = profiler_markup_version|default(1) %}
186
+
187
+ {% set icon %}
188
+ {% if profiler_markup_version == 1 %}
189
+
190
+ {# code for the original toolbar #}
191
+
192
+ {% else %}
193
+
194
+ {# code for the new toolbar (Symfony 2.8+) #}
195
+
196
+ {% endif %}
197
+ {% endset %}
198
+ {% endblock %}
199
+ ```
You can’t perform that action at this time.
0 commit comments