使用smaty时需要检测模板是否存在。


查手册有template_exists函数,使用后毫无效果。。。


错误日志,

“Smarty: Call of unknown method 'template_exists'”


上网找了一下,原来smarty3.X以后,方法的命名规范变了,采用驼峰式的命名方式,如 fooBarBaz,所以检测模板的函数是“templateExists()”。


http://www.smarty.net/docs/zh_CN/api.template.exists.tpl

还是要用官方手册呀。。。