otago/opcolor
Composer 安装命令:
composer require otago/opcolor
包简介
a color palette dropdown
README 文档
README
Creates a colour palette dropdown for SilverStripe 3, 4, or 5.
Color selector
Create your accepted colors and names in the settings tab in the CMS
use the drop down to select your color
Expose the JS/css files
composer vendor-expose
Usage
use OP\ColorField;
public static $db = [
'ClassOverride' => 'Text'
];
function getCMSFields() {
$fields = parent::getCMSFields();
// create the op color field
$colordropdown = ColorField::create('ClassOverride', 'Color Override', $this->ClassOverride);
$colordropdown->setEmptyString('');
$fields->addFieldToTab("Root.Main", $colordropdown, "Content");
return $fields;
}
What it does
It stores the CSSColor in the specified text field. Note the RGB color is the value that colors the box in the dropdown field. Other values, such as the CSSHex and CSSCMYK are optional.
统计信息
- 总下载量: 7.98k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-10-21

