ThinkPhp学习笔记-如何定义Template模板路径

1) 如果只是在application/common/conf/config.conf文件中定义是不包含“模块名”的,提示错误“模板不存在:/mywork/Templates/Index/index.html”,

这里写图片描述

如果定义了2个模块,比如:admin和home,则希望出现模块名,如下所示:

这里写图片描述

方法如下:
在根目录的入口文件index.php中定义如下常量即可:

// 选择默认的配置文件
define('TMPL_PATH','./Templates/');

猜你喜欢

转载自blog.csdn.net/coolhe21cn/article/details/74185291