ControllerClass 'think\Controller' not found in
一座城
一座城 2018-06-24 16:18:01
0
4
2857
namespace admins\controller;

use think\Controller;
use think\Request;

class Account extends Controller{
    public function __construct() {
        parent::__construct();
    }

    function login(){
        return $this->fetch();
    }
}

It’s a very common code. The problem is that the Controller can’t be found. I really don’t understand. Is it clearly possible in the video?

一座城
一座城

reply all(4)
owenzhang

Have you solved it?

小猪cms@洪涛          .

Please take a look at the capitalization of the first letter of Controller. The first namespace is not uniform in capitalization.

  • reply Ah, does the naming convention have an impact?
    一座城 author 2018-06-25 11:26:25
无忌哥哥

Then check if there is a file admins.php in the entry file.

  • reply Hmm, I haven’t tried this, I’ll give it a try when I have time. Thank you for your answer
    一座城 author 2018-06-25 09:16:41
无忌哥哥

namespace app\admins\controller, it should be like this, the namespace is missing an app path

  • reply It doesn't work, I tried it
    一座城 author 2018-06-25 09:13:22
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template