亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Questions about namespace in binding facade
桃子
桃子 2019-02-22 15:13:25
0
3
1048

Encountered this problem when binding facade

//Successful binding
Facade::bind('app\index\facade\Human','app\index\ Common\Human');

Facade::bind('app\index\facade\Human','\app\index\Common\Human');

//Failed binding Define
Facade::bind('\app\index\facade\Human','\app\index\Common\Human');

Xiaobai wants to know why the app is in front of the binding \ cannot be added. Doesn’t it mean starting from the root?

QQ截圖20190222151229.png

QQ截圖20190222151312.png

桃子
桃子

reply all(1)
Peter-Zhu

This is just like you use the "use" keyword to alias the referenced class. The default is to start from the root space,
For example:

namespace?test;
use?app\admin;

//?與下面寫法是完全一樣的

namespace?test;
user?\app\admin;

//?默認(rèn)就是全局空間開始查找

If you want to understand Facade::bind() parameter, you can view the source code of the Facade class. In the source code, there is a detailed description of the bind() method

  • reply Does it mean that although there is no \ in front, the search is actually starting from the root? Then I looked at the Facade source code and understood its binding mechanism. Thank you teacher!
    桃子 author 2019-02-22 16:56:54
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template