PHP code example of yii2mod / yii2-chosen-select

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

    

yii2mod / yii2-chosen-select example snippets


echo $form->field($model, 'subject')->widget(\yii2mod\chosen\ChosenSelect::class, [
    'items' => [
        'first' => 'First',
        'second' => 'Second'
     ],
]); 

echo \yii2mod\chosen\ChosenSelect::widget([
     'name'  => 'select',
     'items' => BooleanEnum::listData(),
     'options' => [
         'width' => '95%'
     ]
 ]);