PHP code example of alexantr / yii2-colorpicker

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

    

alexantr / yii2-colorpicker example snippets


<?= alexantr\colorpicker\ColorPicker::widget(['name' => 'attributeName']) 

<?= $form->field($model, 'attributeName')->widget(alexantr\colorpicker\ColorPicker::className()) 

<?= alexantr\colorpicker\ColorPicker::widget([
    'name' => 'attributeName',
    'clientOptions' => [
        'control' => 'wheel',
        'letterCase' => 'uppercase',
        'theme' => 'default', // the widget uses 'bootstrap' theme
    ],
])