search

Home  >  Q&A  >  body text

For the view content in this chapter, I typed it according to the code in the video, and the created file was also typed according to the video, but why did a page error appear! Please try again later

Code content of

index.php

<?php
namespace app\index\controller;
use think\Controller;
class Index
{
public function index ()
{
Return 'php';
}
Public function Hello ()
{
Return $ This- & GT; fetch ();
} ##}

This is the content of 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>I am the template file corresponding to the hello method in the Index controller in the Index template</h2>
</ body>
</html>

冷酸灵牙膏冷酸灵牙膏2005 days ago1373

reply all(3)I'll reply

  • 木头人

    木头人2019-06-26 22:23:04

    class Index does not inherit Controller

    reply
    0
  • 冷酸灵牙膏

    Yes, it seems there is no inheritance

    冷酸灵牙膏 · 2019-06-30 18:18:51
  • 秋香姐家的小书童

    秋香姐家的小书童2019-06-26 15:05:09

    Enable DEBUG to learn detailed error reasons

    reply
    0
  • Cancelreply