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