xmon/color-picker-type-bundle
最新稳定版本:v1.0.6
Composer 安装命令:
composer require xmon/color-picker-type-bundle
包简介
The ColorPickerTypeBundle extends Symfony2 form types, creates a new ColorPicker form type, to display a javascript color picker.
README 文档
README
DEPRECATED: This bundle is no longer maintained. Symfony includes
ColorTypenatively since version 5.1.
Migration to native
Before (with this bundle)
use Xmon\ColorPickerTypeBundle\Form\Type\ColorPickerType; $builder->add('color', ColorPickerType::class);
Now (Symfony 5.1+)
use Symfony\Component\Form\Extension\Core\Type\ColorType; $builder->add('color', ColorType::class);
Hex color validation
If you were using the HexColor constraint, you can replace it with Regex:
use Symfony\Component\Validator\Constraints as Assert; #[Assert\Regex( pattern: '/^#[0-9a-fA-F]{6}$/', message: 'The color {{ value }} is not valid.' )] public ?string $color = null;
History
This bundle was created in 2013 for Symfony 2, when there was no native form type for colors. It integrated the jscolor library to provide a JavaScript color picker.
With the arrival of HTML5 <input type="color"> and its universal support in modern browsers, Symfony added native ColorType in version 5.1, making this bundle obsolete.
License
MIT
统计信息
- 总下载量: 32.95k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-25