moriony/dadata-bundle
Composer 安装命令:
composer require moriony/dadata-bundle
包简介
README 文档
README
Symfony 2 bundle for Dadata.ru API client.
Configuration
First of all, add yours datada.ru credentials to /app/config/parameters.yml
parameters: dadata.token: *** token *** dadata.secret: *** secret ***
Add bundle configuration to /app/config/config.yml
dadata: clients: default: token: %dadata.token% secret: %dadata.secret% second_client: # You can add multiply clients if you need token: %dadata.token% secret: %dadata.secret%
Register bundle in /app/AppKernel.php
$bundles = array( # ... new Moriony\DadataBundle\DadataBundle(), # ... );
Now dadata bundle is ready to use.
How to use
class DefaultController extends Controller { public function indexAction() { # ... $manager = $this->container->get('dadata.client_manager'); $client = $manager->getClient('default'); $response = $client->cleanAddress("мск сухонска 11/-89"); # ... } }
Installing
This project can be installed using Composer. Add the following to your composer.json:
{ "require": { "moriony/dadata-bundle": "dev-master" } }
Todo
- automated testing
Links
统计信息
- 总下载量: 140
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-27