📜  twig 渲染字符串 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:47.390000             🧑  作者: Mango

代码示例2
$twig = clone $this->get('twig');
$twig->setLoader(new \Twig_Loader_String());
$rendered = $twig->render(
  "Test string template: {{ result|humanize }}",
  array("result" => "mega_success")
);