Note that there are some explanatory texts on larger screens.

plurals
  1. POUnescape or html decode in Twig (PHP Templating)
    primarykey
    data
    text
    <p>I'm using twig 1.12.2. My code generates some elements from code-behind, when rendering these with the latest version of twig they get html-encoded</p> <pre><code>{% for item in files_folders %} &lt;tr class="{{ cycle(['tr_odd', 'tr_even'], loop.index) }}"&gt; &lt;td&gt;&lt;img src="../templates/images/sharepoint/{{ item.ContentType }}.gif" border="0" alt=""/&gt;&lt;/td&gt; &lt;td&gt;{{ item.Link }}&lt;/td&gt; &lt;td&gt;{{ item.Modified }}&lt;/td&gt; &lt;td&gt;{{ item.FileSize }}&lt;/td&gt; &lt;td&gt;{{ item.FileType }}&lt;/td&gt; &lt;/tr&gt; {% endfor %} </code></pre> <p>This will output this</p> <pre><code>&lt;tr class="tr_even"&gt; &lt;td&gt;&lt;img src="../templates/images/sharepoint/Document.gif" border="0" alt=""/&gt;&lt;/td&gt; &lt;td&gt;&amp;lt;a href=&amp;#039;?download=/ddd.png&amp;#039;&amp;gt;ddd.png&amp;lt;/a&amp;gt;&lt;/td&gt; &lt;td&gt;2013-03-04 17:47:38&lt;/td&gt; &lt;td&gt;64.8 KB&lt;/td&gt; &lt;td&gt;png&lt;/td&gt; &lt;/tr&gt; &lt;tr class="tr_odd"&gt; &lt;td&gt;&lt;img src="../templates/images/sharepoint/Document.gif" border="0" alt=""/&gt;&lt;/td&gt; &lt;td&gt;&amp;lt;a href=&amp;#039;?download=/asdasd.png&amp;#039;&amp;gt;asdasd.png&amp;lt;/a&amp;gt;&lt;/td&gt; &lt;td&gt;2013-03-03 20:01:52&lt;/td&gt; &lt;td&gt;66.04 KB&lt;/td&gt; &lt;td&gt;png&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>When I debug and have a look at the data before it's sent to twig it is not escaped. I haven't found any alternative to {{ item.Link }} to render data as-is.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload