Skip to content

Commit 9df0f8b

Browse files
committed
Added some upgrade notes about the new toolbar design
1 parent 22f6bc5 commit 9df0f8b

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

UPGRADE-2.8.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,64 @@ DependencyInjection
136136
<service id="foo" class="stdClass" shared="false" />
137137
</services>
138138
```
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+
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy