canaltp / tyr-bundle
Symfony2 扩展包,提供 Tyr 服务。
1.3.0
2016-02-25 08:56 UTC
Requires
- php: >=5.2
- canaltp/tyr-component: ~1.2
- symfony/dependency-injection: ~2.3
- symfony/http-kernel: ~2.3
This package is not auto-updated.
Last update: 2024-09-14 18:42:13 UTC
README
Symfony2 扩展包,提供了一个具体的 AbstractTyrService。
此扩展包使用 TyrComponent。
安装
使用 composer 安装
{ "require": { "canaltp/tyr-bundle": "1.1.x" } }
更新 AppKernel.php
public function registerBundles() { $bundles = array( // ... new CanalTP\TyrBundle\CanalTPTyrBundle(), ); }
更新 app/config.yml
# Tyr api configuration canal_tp_tyr: url: %tyr_url% end_point_id: 2 # Optional, can also be set with setEndPointId
在 parameters.yml 中添加参数
parameters: tyr_url: http://tyr.dev.canaltp.fr/v0/
使用方法
// Accessing service $tyrApi = $container->get('canal_tp_tyr.api'); $tyrApi->setEndPointId(1); // If not set in configuration // Call api $user = $tyrApi->getUserByEmail('...');
许可证
本项目遵循 GPL-3.0 许可证。