search

Home  >  Q&A  >  body text

ControllerClass 'think\Controller' not found in

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?

一座城一座城2393 days ago2900

reply all(4)I'll reply

  • owenzhang

    owenzhang2022-02-16 17:05:44

    Have you solved it?

    reply
    0
  • 秋香姐家的小书童

    秋香姐家的小书童2018-06-25 11:19:44

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

    reply
    0
  • 一座城

    Ah, does the naming convention have an impact?

    一座城 · 2018-06-25 11:26:25
  • 无忌哥哥

    无忌哥哥2018-06-25 09:15:33

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

    reply
    0
  • 一座城

    Hmm, I haven’t tried this, I’ll give it a try when I have time. Thank you for your answer

    一座城 · 2018-06-25 09:16:41
  • 无忌哥哥

    无忌哥哥2018-06-25 09:12:42

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

    reply
    0
  • 一座城

    It doesn't work, I tried it

    一座城 · 2018-06-25 09:13:22
  • Cancelreply