PHP code example of dvixi / yii2-icon-select

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

    

dvixi / yii2-icon-select example snippets


$items = [
    "icon1.png",
    "icon2.png",
];

echo \dvixi\IconSelectWidget::widget([
    'model' => $model,
    'attribute' => 'attributeName',
    'items' => $items,
    'options' => [
        //Html::activeInput() options
    ],
    'pluginOptions' => [
        // iconselect.js options
    ],
]);

echo $form->field($model, 'attribute')->widget(\dvixi\IconSelectWidget::className(), [
    'items' => $items,
    'pluginOptions' => [...],
]);