[求助] thinkphp使用smarty模板报错

浏览:1632 发布日期:2015/04/01 分类:求助交流 关键字: smarty
刚刚接触thinkphp, 以前用过smarty模板,所以想在tp里使用,但是运行的报错,哪位大虾能帮忙看看这是怎么回事,哪里配的有问题吗?谢谢!
错误信息:
Unable to load template file 'ion/Home/index.tpl'
错误位置

FILE: D:\wamp\www\thkphp\ThinkPHP\Library\Vendor\Smarty\sysplugins\smarty_internal_templatebase.php  LINE: 129
------------------------------------------

按照网上的资料,在项目的config.php中做了如下配置:
'TMPL_ENGINE_TYPE' => 'Smarty',
'TMPL_TEMPLATE_SUFFIX'=>'.tpl',
'TMPL_ENGINE_CONFIG' => array(
'template_dir' =>'./Application/Home/View/Tpl/templates/',
'cache_dir' => './Application/Home/View/Tpl/cache/',
'config_dir' => './Application/Home/View/Tpl/configs/',
'compile_dir' => './Application/Home/View/Tpl/templates_c/',
),

IndexController:
$this->display('./Application/Home/View/Tpl/templates/index.tpl');

PS: 想问一下,调用smarty模板的时候,可以直接像smarty里简短调用吗,这个路径太长了。。不知道是不是我配置的问题,只用display('index')的话,还是找的View/Index/index.tpl

非常非常谢谢!
最佳答案
评论() 相关
后面还有条评论,点击查看>>