eos / com-view-client-bundle
eos/com-view-client 的 Symfony 集成
2.0.0
2019-07-22 20:11 UTC
Requires
- php: >=7.2
- ext-json: *
- eos/com-view-client: ^2.0
- symfony/framework-bundle: ^4.0
This package is auto-updated.
Last update: 2024-09-24 00:09:03 UTC
README
这是对 enm/com-view-client 的 Symfony 集成。
安装
composer require eos/com-view-client-bundle
配置
eos_com_view_client: clients: # the key, in this example "api", will be your client name api: base_uri: 'http://example.com/api' # the base uri used with this api client
使用
要访问单个客户端,您可以使用 Eos\Bundle\ComView\Client\ComViewClientRegistryInterface::getClient($name) 调用,其中 $name 如上面配置中给出的配置键。
Eos\Bundle\ComView\Client\ComViewClientRegistryInterface 可作为服务使用。
每个客户端都可作为服务使用,其唯一 ID 为 eos.com_view.client.CONFIGURED_NAME。
第一个配置的客户端也将作为服务 Eos\ComView\Client\ComViewClient 使用,以便进行自动装配。