PHP code example of maxdancepro / yii2-autocomplete

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

    

maxdancepro / yii2-autocomplete example snippets


<?= $form->field($model, 'attribute_id')->widget(AutoComplete::className()); 

echo $form->field($model, 'attribute')->widget(AutoComplete::className(), [
'clientOptions' => [
     'source' => Url::to(['/controller/autocomplete'])
]
])

echo $form->field($model, 'attribute_id')->widget(AutoComplete::className());

echo $form->field($model, 'attribute_id')->widget(AutoComplete::className(), [
'clientOptions' => [
     'source' => [
         ['id' => 1, 'label' => 'Label 1'],
         ['id' => 2, 'label' => 'Label 2'],
         ...
     ]
]
])

php composer.phar