-1
with
키워드로 일부 html을 전달하면서 다른 html.twig 파일을 포함하려는 .html.twig 파일이 있습니다. 문제는 그것이 HTML이지만 일반 텍스트로 렌더링되지 않는다는 것입니다. 예 :나뭇 가지 안에 'html이있는'나뭇 가지를 포함합니다.
#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 콘텐츠를 내가 볼
This is <br/> HTML content
'{{text | raw}}'이스케이프를 막기 위해'raw' 필터를 사용해야합니다. – DarkBee