codein/ez-color-picker
Composer 安装命令:
composer require codein/ez-color-picker
包简介
eZplatform color picker field type
README 文档
README
Symfony bundle that adds color management to eZ Platform.
Note : this is the compatibility branch for eZ Platform 2.5 (ezsystems/ezpublish-kernel:7.5). For a Ibexa Platform compatible version, please check this repository instead : https://github.com/Codein-Labs/ibexa-color-picker
Installation
composer require codein/ez-color-picker:dev-develop
Activate the bundle in AppKernel.php
new Codein\eZColorPicker\eZColorPickerBundle()
Compile the assets for the admin UI
./bin/console ezplatform:encore:compile
Usage
Default value
You can set a default color for your field. The default color will be proposed to the user if no color is already set. If the field is required, the default color is assigned as default. If not, no color is assigned.
Twig
The default color format rendered in Twig is RGBa. You can pass extra options to ez_render_field.
- format: RGBa, HEXa, HSVa, RGB, HEX
- default: default value returned if field is empty. If not set ez_render_field will return an empty string
{{ ez_render_field(content, 'color2', {'parameters': {'format': 'HEX', 'default': 'none'}}) }}
Migration
The method \Codein\eZColorPicker\FieldType\ColorPicker\Type::acceptValue will accept a single string and convert it into a color. Following formats are converted into a valid value object :
HSVa: hsva(0, 86%, 69%, 0.69)
RGBa: rgba(176, 25, 25, 0.69)
HEXa: #B01919B0
RGB: rgb(176, 25, 25)
HEX: #B01919
You can use this feature when writing migrations.
We also provide a color converter service for your needs here.
Acknowledgement
This bundle uses Pickr (https://github.com/Simonwep/pickr) under the MIT Licence.
codein/ez-color-picker 适用场景与选型建议
codein/ez-color-picker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.56k 次下载、GitHub Stars 达 9, 最近一次更新时间为 2020 年 09 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 codein/ez-color-picker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 codein/ez-color-picker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3.56k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-23