moriony / dadata-bundle
Installs: 140
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/moriony/dadata-bundle
Requires
- php: >=5.4
- moriony/dadata-client: dev-master
- symfony/symfony: ~2.6
This package is auto-updated.
Last update: 2025-09-25 21:26:53 UTC
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