不繼承Controller,就不能用fetch()函數php
use think\Controller;app
還要:extends Controller函數
<?php namespace app\index\controller; use think\Controller; class Index extends Controller { public function index() { return $this->fetch(); } }