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

1. Go to this page and download the library: Download nikovonlas/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/ */

    

nikovonlas / 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'
])