0

I've seen that we can syntax highlight dump()ed variables into templates by installing xdebug.

I installed it on Ubuntu with

$ sudo apt-get install php5-xdebug

Trying to dump an array

{{ dump(my_array) }}

I'm now getting the html markup for the highlighted syntax but escaped in the HTML

<pre class='xdebug-var-dump' dir='ltr'>
<b>array</b> <i>(size=2)</i>
  0 <font color='#888a85'>=></font> 
    <b>array</b> <i>(size=11)</i>

Why is it coming escaped ?

Pierre de LESPINAY
  • 44,700
  • 57
  • 210
  • 307

1 Answers1

2

Because Twig escapes markup by default.

In order to see formatted output, use the raw filter

{{ dump(my_array)|raw }}
moonwave99
  • 21,957
  • 3
  • 43
  • 64