blitzr / api-client-bundle
Blitzr官方Symfony API客户端
1.0.0
2016-01-25 15:09 UTC
Requires
- blitzr/php-client: 1.*
This package is not auto-updated.
Last update: 2024-09-14 18:26:11 UTC
README
为Blitzr API提供PHP API客户端包。
要使用此包,您需要一个API密钥,您可以在https://blitzr.io请求。
文档
此服务实现了来自官方Blitzr PHP客户端的所有方法。您还可以使用此包的PHP客户端文档作为参考。
您还可以参考官方的Blitzr API参考以获取更多信息。
安装
首先将BlitzrApiClientBundle添加到您的composer需求中。
$ composer require blitzr/api-client-bundle
然后在Kernel中启用此包。
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Blitzr\ApiClientBundle\BlitzrApiClientBundle(), // ... ); }
将API密钥添加到您的配置中。
// app/config/config.yml ... # BlitzrApiClientBundle blitzr_api_client: api_key: "your_api_key"
这就完成了!
入门
此包提供给您一个服务,以下是如何获取艺术家或标签的示例。
// Get the service $blitzrClient = $this->get('blitzr_api_client.client'); // Request the artist $artist = $blitzrClient->getArtist('year-of-no-light'); // Request a tag $tag = $blitzrClient->getTag('rock');