鍍金池/ 問(wèn)答/PHP/ TP5.1怎么使用視圖模版呢 我這個(gè)報(bào)錯(cuò)了

TP5.1怎么使用視圖模版呢 我這個(gè)報(bào)錯(cuò)了

這是項(xiàng)目目錄
圖片描述

路由這么寫(xiě)的Route::get('/test', 'index/test/test');

下面是控制器test.php

<?php
namespace app\index\controller;
use think\Controller;
use think\request;
use think\response;
use think\View;
class Test extends Controller
{
    public function test(){
        return $this->fetch();
    }
}

我想把test視圖模版顯示出來(lái)應(yīng)該怎么辦呢 我這樣試了一下報(bào)錯(cuò)了
圖片描述

回答
編輯回答
念初

圖片描述

斜杠 用對(duì)了嗎

2018年3月30日 07:16
編輯回答
夢(mèng)囈

路徑明顯跟你文件夾合不上得嘛,在view下面建test目錄再建test.html

2017年7月10日 05:03