smartyでhtml形式の変数をhtmlとして
表示するための方法を調べていていくつかパターンがあり、
環境によって適応できる形式が異なるようなのでまとめました。
例えば
$test = '<b>こんにちは<b>'
というhtml変数があったとして
<b>こんにちは<b>
ではなく
こんにちは
というように太字で表示させたい(htmlを反映させたい)時の出力方法です。
いくつかのサイトを見ましたが以下の3つのうち、1つしか書いていない記事が多く混乱したのでまとめました。
以下の3パターンを試せばどれかでうまくいくと思います。
{$test nofilter}
{$test|smarty:nodefaults}
{$test|unescape}
もし他のパターンがあれば教えてください!