Home  >  Article  >  Backend Development  >  Why is it prompted that the controller cannot be loaded?

Why is it prompted that the controller cannot be loaded?

WBOY
WBOYOriginal
2016-07-06 13:53:417421browse

This is the code and path of the controller

<code><?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function qq(){
        $this->display();
    }
}
?></code>

Why is it prompted that the controller cannot be loaded?

This is the path to the view template

Why is it prompted that the controller cannot be loaded?

This is how I visited

<code>http://localhost/a/qq/index.php/home/first/qq</code>

Then prompt this error
Why is it prompted that the controller cannot be loaded?

Reply content:

This is the code and path of the controller

<code><?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function qq(){
        $this->display();
    }
}
?></code>

Why is it prompted that the controller cannot be loaded?

This is the path to the view template

Why is it prompted that the controller cannot be loaded?

This is how I visited

<code>http://localhost/a/qq/index.php/home/first/qq</code>

Then prompt this error
Why is it prompted that the controller cannot be loaded?

Why is it prompted that the controller cannot be loaded?
Note the class name

Looks like you should be using the TP framework. The controller file name and class name of the TP framework should be consistent.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn