ThinkPHP’s Facade vs. Laravel’s Facade

ThinkPHP’s facade implementation borrows from Laravel’s real-time facades feature: it lets you call non-static methods on a class statically, without needing to instantiate it first.

But it’s not as seamless as Laravel’s version (where you just prefix the class with the Facades\ namespace during import, and it magically turns into a facade). In ThinkPHP, you have to roll your own facade class manually.

ThinkPHP框架的门面(Façade) vs Laravel框架的的门面

ThinkPHP框架的门面实现了Laravel框架的实时门面(Real-Time Facades)特性:可以让某个类无需实例化而直接进行静态方式调用它的非静态方法。

但是没有Laravel框架的实时门面那么方便(只需在use一个类时,加上Facades\命名空间前缀,这个类就自动变成了一个门面),ThinkPHP框架需要你自己写门面类。