2016-12-13 15 views
-1

私はwithキーワードでいくつかのhtmlを渡しながら、別のhtml.twigファイルを含める.html.twigファイルを持っています。問題は、HTML形式ではなくプレーンテキスト形式でレンダリングされることです。 例:問題は結果ではなく、ということですtwig 'with' html in twigを含む

#base.html.twig 
<div> 
    Some content ... 
    {% include 'AppBundle::partials/speech-bubble.html.twig' with {'text': "This is <br/> HTML content"} %} 
<div> 

#speech-bubble.html.twig 
<div class="speechbubble-wrapper"> 
    <div class="speechbubble-text"> 
    {{ text }} 
    </div> 
</div> 

これは
HTMLコンテンツ

ある@DarkBeeがコメントとして、私は

This is <br/> HTML content 
+1

'{{text | raw}} 'エスケープを防ぐために' raw'フィルタを使うべきです – DarkBee

答えて

1

を見ます、テキストフィルタで未処理のフィルタを使用してpを解いた事実:{{ text | raw }}。ありがとうございました!

関連する問題