V
V
Valentine2016-07-25 10:45:16
PHP
Valentine, 2016-07-25 10:45:16

Twig templating engine: How to render text without Twig processing?

Good day!
You need to output a <script type="template/text"></script>template in the block to create a component:

<script id="layout-property-sheet" type="template/text">
                            <div class="db-properties-widget">
                                <h4>Вид</h4>
                                <div class="db-properties-block">
                                    <h3>Общие</h3>
                                    <div class="db-properties-param-group">
                                        <div class="db-properties-param">
                                            <label>Тип слоя</label>
                                        <select id="wefwe" class="form-control input-sm" style="width:100%">
// Вот этот блок обрабатывается моим JS-шаблонизатором на фронтенде, на него и ругается Twig
                                            <%for(var index in this.fields) {%>
                                            <option></option>
                                            <a href="#"><%this.skills[index]%></a>
                                            <%}%>
                                        </select>
                                        </div>
                                    </div>
                                </div>
                            </div> 
                        </script>

I need Twig to ignore everything in the <script ...>
PS block: tried
{% autoescape false %}
.....
{% endautoescape %}

For some reason it doesn't work ((
PSS: raw works, thanks to all))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Romanenko, 2016-07-25
@Tpona

Have you tried twig.sensiolabs.org/doc/filters/raw.html?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question