PHP code example of silverware / colorpicker

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

    

silverware / colorpicker example snippets


use SilverStripe\ORM\DataObject;

class MyObject extends DataObject
{
    private static $db = [
        'MyColor' => 'Color'
    ];
}

use SilverStripe\ORM\DataObject;
use SilverWare\Colorpicker\ORM\FieldType\DBColor;

class MyObject extends DataObject
{
    private static $db = [
        'MyColor' => DBColor::class
    ];
}

ColorField::create('MyColor', $this->fieldLabel('MyColor'));

use SilverWare\Colorpicker\Forms\ColorField;