安装tp5之后,想修改首页内容,加入视图html文件。
1、在application\index\目录下,新建文件夹view,view下创建文件夹index
2、在index下创建html文件index

3、application\index\controller\Index.php中修改,使用fetch

4、这时再访问,就【页面错误】
原来使用fetch,就得继承Controller

本文详细介绍在ThinkPHP5框架中,如何正确设置首页视图,包括创建视图目录、HTML文件及控制器调用方法,解决fetch使用时的常见错误。
安装tp5之后,想修改首页内容,加入视图html文件。
1、在application\index\目录下,新建文件夹view,view下创建文件夹index
2、在index下创建html文件index

3、application\index\controller\Index.php中修改,使用fetch

4、这时再访问,就【页面错误】
原来使用fetch,就得继承Controller
