-
Notifications
You must be signed in to change notification settings - Fork 0
Home
royee edited this page Feb 8, 2023
·
1 revision
Welcome to the facade wiki!
$container = Container::instance();
FacadeFactory::setContainer($container);
Facade 应该是 AbstractFacade 的一个实例,并且应该提供一个访问器。
访问者是服务标识符。它将用于获取容器中的服务.
class TestFacade extends AbstractFacade
{
protected static function accessor()
{
return TestService::class;
}
}
$service = TestFacade::instance();
TestFacade::someMethod();
或者
$service = TestFacade::instance();
$service->someMethod();