【smarty模板的作用】smarty模板提示Warning: Smarty error: unable to read resource

时间:2017-10-15  来源:smarty模板  阅读:

PHP使用模板引擎smarty,读取模板出错提示:Warning: Smarty error: unable to read resource: ”index.html” in libs\Smarty.class.php on line 1095

问题原因:模板目录设置不正确

解决方法:

在出错页面调用echo $Tpl->template_dir; 查看模板对应的位置,在配置文件里修改相应模板正确位置即可。

还有一种可能就蛤我的index.html模板文件不存在也会提示找不到模板文件哦。


注意:

正斜杠 /     与反斜杠     是一样的,但是要注意:反斜杠   在PHP中为转义字符,没有意义。如要输出单引号 "   则应该写成 ",因此 \ "  实际上就是  / " 。注意,模版文件要与调用模版文件的字符集编码一样,否则也会出现上面的错误!

【smarty模板的作用】smarty模板提示Warning: Smarty error: unable to read resource

http://m.bbyears.com/jiaocheng/36330.html

推荐访问:
相关阅读 猜你喜欢
本类排行 本类最新