2017 © Pedro Peláez
 

library dadata-bundle

image

moriony/dadata-bundle

  • Friday, October 16, 2015
  • by moriony
  • Repository
  • 1 Watchers
  • 0 Stars
  • 134 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Dadata Bundle for Symfony 2

Symfony 2 bundle for Dadata.ru API client., (*1)

Configuration

First of all, add yours datada.ru credentials to /app/config/parameters.yml, (*2)

parameters:
    dadata.token: *** token ***
    dadata.secret: *** secret ***

Add bundle configuration to /app/config/config.yml, (*3)

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, (*4)

  $bundles = array(
    # ...
    new Moriony\DadataBundle\DadataBundle(),
    # ...
  );

Now dadata bundle is ready to use., (*5)

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:, (*6)


{ "require": { "moriony/dadata-bundle": "dev-master" } }

Todo

  • automated testing

The Versions

16/10 2015

dev-master

9999999-dev

  Sources   Download

MIT

The Requires