The following tutorial column of thinkphp will introduce to you what happens when the TP5 framework namespace controller inheritance is invalid. I hope it will be helpful to friends in need!
Today I would like to share with you the TP5 namespace
There are always problems with TP5 when I am working on projects these days. The company needs to write a small function login function
Then it is invalid when inheriting the login, so I will sort it out for everyone. The masters will skip it. This is still relatively basic. If it is useful, everyone will take a look. If it is not useful, everyone will skip it.
namespace app\index\Controller; use think\Controller; use think\Request; use think\Db; use app\index\controller\Login; class Formall extends Login {
The following is the inherited class
namespace app\index\Controller; use think\Controller; use think\Request; use think\Db; class Login extends Controller
3. This class must inherit Controller
4. Not only must it inherit Controller, but also use think\Controller;
namespace app\index\Controller; This controller represents the directory
These two are They have completely different meanings. Please note that if the capitalization of any word in
is wrong, an error will be reported.
The latest 10 thinkphp video tutorials
The above is the detailed content of What happens when the TP5 framework namespace controller inheritance is invalid?. For more information, please follow other related articles on the PHP Chinese website!