Reputation: 46208
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'>=&gt;</font>
<b>array</b> <i>(size=11)</i>
Why is it coming escaped ?
Upvotes: 0
Views: 381
Reputation: 22810
Because Twig escapes markup by default.
In order to see formatted output, use the raw filter
{{ dump(my_array)|raw }}
Upvotes: 2