PHP code example of xdan / yii2-icon-select

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

    

xdan / yii2-icon-select example snippets


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

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

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