PHP code example of akavov / yii2-bootstrap-tokenfield

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

    

akavov / yii2-bootstrap-tokenfield example snippets


php composer.phar 

<?= \akavov\tokenfield\Tokenfield::widget([
    'name' => 'inputName',
]);

<?= \akavov\tokenfield\Tokenfield::widget([
    'name' => 'inputName',
    "pluginOptions" => [
        'delimiter' => '#', // default ',' (comma)
        'showAutocompleteOnFocus' => true,
        'autocomplete' => [
            'source' => ['red','blue','green','yellow','violet','brown','purple','black','white'],
            'delay' => 100
        ],
    ],
]);

<?= $form->field($model, 'name')->widget(\akavov\tokenfield\Tokenfield::className(), [
    'pluginOptions' => [
        'delimiter' => '#', // default ',' (comma)
        'showAutocompleteOnFocus' => true,
        'autocomplete' => [
            'source' => ['red','blue','green','yellow','violet','brown','purple','black','white'],
            'delay' => 100
        ],
    ],
]);