在这一章节里面的视图方面的内容,我按视频上的代码来打上去,创建的文件也是按照视频的来打但为什么却输出页面错误!请稍后再试
冷酸灵牙膏
冷酸灵牙膏 2019-06-26 01:07:34
[PHP讨论组]

index.php的代码内容

<?php
namespace app\index\controller;
use think\Controller;
class Index
{
   public function index()
   {
       return 'php';
   }
   public function hello()
   {
       return $this->fetch();
   }
}

这个是hello.html的内容

<!doctype html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
   <meta http-equiv="X-UA-Compatible" content="ie=edge">
   <title>Document</title>
</head>
<body>
   <h2>我是Index模板中的Index控制器中的hello方法对应的模板文件</h2>
</body>
</html>

冷酸灵牙膏
冷酸灵牙膏

全部回复(2)
木头人

class Index  没有继承 Controller

  • 回复 是的,好像是没有继承
    冷酸灵牙膏 作者 2019-06-30 18:18:51
秋香姐家的小书童

开启DEBUG 了解详细错误 原因

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号