Error reported after inheriting Controller class
22
22 2021-08-30 14:16:31
0
5
1576

<?php

namespace app\admins\controller;

use think\Controller;

use Util\data\Sysdb;

class Test extends Controller

{

public function index(){

$this->db = new Sysdb ;

$res = $this->db->table('admins')->field('id,username')->lists();

dump ($res);

}

}

will show that the web page cannot operate. If you remove the extends Controller, this error will not be reported

22
22

reply all(3)
逆旅行人

Are you tp6 or 5? tp6 inherits BaseController

  • reply tp5, I found the reason, there is no access from the entry file
    22 author 2021-09-02 16:36:40
22

截屏2021-08-31 09.25.41.pngI reported this error, and I have turned on the debug mode

截屏2021-08-31 09.26.25.png

逆旅行人

What error will be reported? Let’s take a look at the screenshots

  • reply I posted it below. Take a look.
    22 author 2021-08-31 09:27:35
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template