私はtwigテンプレートとの関係に問題があります。 codes.namely同じHTMLとしてphp twigテンプレートhtmlコード
final class index {
public $request;
private $loader;
private $twig;
/**
* Constructor.
* definition : class preloader with default
* symfony component request class
* twig template configuration
* @param type dependency injection and function
*/
public function __construct(){
//get request info
$this->request=new request();
$this->loader = new \Twig_Loader_Filesystem(root.'/src/declarations/twigTemplate');
$this->twig = new \Twig_Environment($this->loader, array(
//'cache' => root.'/src/declarations/twigTemplate/cache',
));
}
/**
* get declaration main function.
* definition:index method is defined in a declaration
* and it is called as https://ip/company/service/app/service/doc
* @param type dependency injection and function
* @return array
*/
public function index(){
//return
return $this->twig->render("index.twig",['var'=>'foo']);
}
}
私の小枝ファイルの出力は、HTMLのコードを実行されません。
index.twigファイル:
<strong>{{ var }}</strong>
出力:
<strong>foo</strong>
私はあなたがautoescapeタグおよび/または生を使用する必要があなたの答え
'autoescaper'設定を変更しましたか? – DarkBee
私はそれを試して、それは動作しません。 – JoBlox
あなたはあなたがすでにそれを解決できると言った答えを投稿しましたが、おそらくあなたは小枝の文書を読んで、私が答えとして投稿したものを見つけましたか? –