Blogger Information
Blog 5
fans 0
comment 0
visits 4308
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
ThinkPHP 中静态代理的浅想
Dream698
Original
813 people have browsed it

class Demo
{
public function say()
{
return “hello,world”;
}
}

创建Demo的静态代理,(静态代理的名字和类名要求一致)。并继承\thinkphp\facade\类,重写protected static getFacadeClass(){ return ‘app\controller\Demo’;}

Demo::say()直接简化了 $obj=new Demo();$obj->say()方法的调用。

问题:类的静态化底层的实现原理?

或是:
Demo的静态代理直接竭诚Facade,类体为空。然后通过\think\Facade::bind(‘静态代理类’,’类的绝对地址’)

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments