PHP code example of corpsepk / yii2-dadata-suggestions-widget

1. Go to this page and download the library: Download corpsepk/yii2-dadata-suggestions-widget library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

corpsepk / yii2-dadata-suggestions-widget example snippets


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

use corpsepk\DaData\SuggestionsWidget;

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

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

<?= $form->field($model, 'inn')->widget(SuggestionsWidget::class, [
    'token' => 'your apiKey'
])