1 | <?php |
||
3 | class ColorpickerField extends TextField |
||
|
|||
4 | { |
||
5 | /** |
||
6 | * Spectrum Colorpicker Options |
||
7 | * |
||
8 | * 'color' => false, |
||
9 | * 'flat' => false, |
||
10 | * 'showInput' => false, |
||
11 | * 'allowEmpty' => false, |
||
12 | * 'showButtons' => true, |
||
13 | * 'clickoutFiresChange' => true, |
||
14 | * 'showInitial' => false, |
||
15 | * 'showPalette' => false, |
||
16 | * 'showPaletteOnly' => false, |
||
17 | * 'hideAfterPaletteSelect' => false, |
||
18 | * 'togglePaletteOnly' => false, |
||
19 | * 'showSelectionPalette' => true, |
||
20 | * 'localStorageKey' => false, |
||
21 | * 'appendTo' => "body", |
||
22 | * 'maxSelectionSize' => 7, |
||
23 | * 'cancelText' => "cancel", |
||
24 | * 'chooseText' => "choose", |
||
25 | * 'togglePaletteMoreText' => "more", |
||
26 | * 'togglePaletteLessText' => "less", |
||
27 | * 'clearText' => "Clear Color Selection", |
||
28 | * 'noColorSelectedText' => "No Color Selected", |
||
29 | * 'preferredFormat' => false, |
||
30 | * 'containerClassName' => "", |
||
31 | * 'replacerClassName' => "", |
||
32 | * 'showAlpha' => false, |
||
33 | * 'theme' => "sp-light", |
||
34 | * 'palette' => array("#ffffff", "#000000", "#ff0000", "#ff8000", "#ffff00", "#008000", "#0000ff", "#4b0082", "#9400d3"), |
||
35 | * 'selectionPalette' => [], |
||
36 | * 'disabled' => false, |
||
37 | * 'offset' => null |
||
38 | **/ |
||
39 | |||
40 | public function __construct($name, $title = null, $value = '', $form = null) |
||
44 | |||
45 | public function Field($properties = array()) |
||
56 | |||
57 | public function setOptions($options = array()) |
||
61 | |||
62 | public function setColorMode() |
||
66 | } |
||
67 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.