2017 © Pedro Peláez
 

yii2-extension yii2-dadata-suggestions-widget

DaData Suggestions jQuery widget wrapper

image

corpsepk/yii2-dadata-suggestions-widget

DaData Suggestions jQuery widget wrapper

  • Tuesday, March 13, 2018
  • by corpsepk
  • Repository
  • 2 Watchers
  • 8 Stars
  • 3,614 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 24 % Grown

The README.md

yii2-dadata-suggestions-widget

Latest Version Build Status Coverage Status Quality Score, (*1)

Wrapper for DaData's jQuery plugin, (*2)

Installation

1. Download

The preferred way to install this extension is through composer., (*3)

Run the following command:, (*4)

$ composer require corpsepk/yii2-dadata-suggestions-widget:~0.4

2. Get api key

Register at DaData.ru, and get api key., (*5)

3. Configure (optional)

You can setup container definitions if you do not want to enter api key in every widget. Add following lines to your main configuration file:, (*6)

'container' => [
    'definitions' => [
        'corpsepk\DaData\SuggestionsWidget' => [
            'token' => 'my-dadata-api-key',
        ],
    ],
],

Usage

use corpsepk\DaData\SuggestionsWidget;
<?= SuggestionsWidget::widget([
    'model' => $model,
    'attribute' => 'inn',
    'token' => 'your apiKey'
]) ?>

The following example will use the name property instead:, (*7)

<?= SuggestionsWidget::widget([
    'name' => 'inn',
    'token' => 'your apiKey'
]) ?>

You can also use this widget in an yii\widgets\ActiveForm using the yii\widgets\ActiveField::widget() method, for example like this:, (*8)

<?= $form->field($model, 'inn')->widget(SuggestionsWidget::class, [
    'token' => 'your apiKey'
]) ?>
  • DaData - https://dadata.ru
  • jQuery plugin - https://github.com/hflabs/suggestions-jquery
  • jQuery plugin options - https://confluence.hflabs.ru/pages/viewpage.action?pageId=204669097
  • Hints - https://dadata.userecho.com/topics/2090

Testing

$ ./vendor/bin/phpunit

The Versions

13/03 2018

dev-master

9999999-dev

DaData Suggestions jQuery widget wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 widget suggestions dadata

13/03 2018

0.3

0.3.0.0

DaData Suggestions jQuery widget wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 widget suggestions dadata

03/03 2017

0.2

0.2.0.0

DaData Suggestions jQuery widget wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

yii2 widget suggestions dadata

02/03 2017

0.1

0.1.0.0

DaData Suggestions jQuery widget wrapper

  Sources   Download

MIT

The Requires

 

yii2 widget suggestions dadata