doulaozhi6835
2017-01-04 10:32
浏览 36
已采纳

Twig_Error_Loader目录不存在

I want to change render path of twig. I am using twig with codeigniter. my code is below:

$loader = new Twig_Loader_Filesystem(FCPATH.'themes/site/default');
$twig = new Twig_Environment($loader);
$twig->load('layout.twig.php');
echo $twig->render(APPPATH.'views/site/welcome.twig.php', $data);

But code is giving error:

Type: Twig_Error_Loader

Message: Unable to find template "/var/www/html/test.ab/application/views/site/welcome.twig.php" (looked into: /var/www/html/test.ab/themes/site/default).

Filename: /var/www/html/test.ab/vendor/twig/twig/lib/Twig/Loader/Filesystem.php

Line Number: 232
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题