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

Why is it prompted that the controller cannot be loaded?

WBOY
Release: 2016-07-06 13:53:41
Original
7450 people have browsed it

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>
Copy after login
Copy after login

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>
Copy after login
Copy after login

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>
Copy after login
Copy after login

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>
Copy after login
Copy after login

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.

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template