xman1988 / yii2-color-filter-widget
Yii2 的图像颜色滤镜小部件。用于对图像应用颜色滤镜的视觉编辑器
dev-master
2019-08-13 20:58 UTC
Requires
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-09-14 09:12:32 UTC
README
Yii2 的图像颜色滤镜小部件。用于对图像应用颜色滤镜的视觉编辑器
安装
建议通过 composer 安装此小部件。
或者在控制台运行命令
php composer.phar require --prefer-dist xman1988/yii2-color-filter-widget "*"
或者在 composer.json
文件的 require 部分添加命令
"xman1988/yii2-color-filter-widget": "*"
快速入门
当小部件安装到您的项目后,将以下代码添加到您的文件中
<?= \xman1988\yii2ColorFilterWidget\ColorWidget::widget(); ?>
使用参数
您可以将小部件连接到页面,并设置以下参数来配置它
<? use xman1988\yii2ColorFilterWidget\ColorWidget; echo ColorWidget::widget( [ 'width'=>600, 'height'=>800, 'nameDefaultPicture' => 'default.jpg', 'filterGrey' => true, 'filterRed' => true, 'filterGreen' => true, 'filterBlue' => true ] ); ?>
参数说明
'width' - (值类型 - integer) 图像窗口边框的宽度。默认值:600
'height' - (值类型 - integer) 图像窗口边框的高度。默认值:600
'nameDefaultPicture' - (值类型 - string) 默认图像名称。默认值:'default'
'filterGrey' - (值类型 - boolean) 启用/禁用图像上灰色滤镜的参数。默认值:'true'
'filterRed' - (值类型 - boolean) 启用/禁用红色滤镜的参数。默认值:'true'
'filterGreen' - (值类型 - boolean) 启用/禁用绿色滤镜的参数。默认值:'true'
'filterBlue' - (值类型 - boolean) 启用/禁用蓝色滤镜的参数。默认值:'true'