lubosdz/yii2-ui-range-plus-minus
Composer 安装命令:
composer require lubosdz/yii2-ui-range-plus-minus
包简介
UI input widget for Yii2 framework
README 文档
README
Widget for framework Yii2 which enables to collect numeric values within specified min - max range. Supports increasing - decreasing the value by configured step and basic theming for bootstrap 3 or 4.
Installation
$ composer require "lubosdz/yii2-ui-range-plus-minus" : "~1.1.0"
Usage
use lubosdz\ui\RangePlusMinus; <?= $form->field($model, 'area_m2')->widget(RangePlusMinus::className(), [ 'bsVersion' => 3, // <-- enforce bootstrap 3 layout, since 1.0.3 is default BS4 'unit' => 'm2', 'min' => 10, 'max' => 100, 'tooHigh' => Yii::t('app', 'Maximum value is {max}.'), 'tooLow' => Yii::t('app', 'Minimum value is {min}.'), 'step' => 5, 'cssClassMinus' => 'glyphicon glyphicon-minus', 'cssClassPlus' => 'glyphicon glyphicon-plus', 'options' => [ 'onchange' => new JsExpression('console.log(this)'), ], ]) ?> <?= RangePlusMinus::widget([ 'model' => $model, 'attribute' => 'frequency', 'unit' => 'MHz', 'min' => 10, 'max' => 100, 'decimals' => 3, 'step' => 0.05, 'cssMinusButton' => 'bg-success text-white', 'cssMinusIcon' => 'fa fa-chevron-down', 'cssPlusButton' => 'bg-info text-white', 'cssPlusIcon' => 'fa fa-chevron-up', ]) ?>
Widget options
| Option | Description |
|---|---|
| unit | Measure unit, e.g. kg, MHz |
| cssWrapper | CSS class to set field width within a row, defaults to col-md-12 |
| thousandSep | Thousands separator, defaults to empty string |
| decimalsSep | Decimals separator, defaults to comma . |
| min | Minimum allowed value |
| max | Maximum allowed value |
| step | Value increased or decreased by this value, defaults to 1. |
| defaultValue | The value set on first load |
| tooHigh | Error message to show when the new value is higher than max value |
| tooLow | Error message to show when the new value is lower than min value |
| decimals | How many decimals should be value formatted to, default 0 |
| roundPrecision | How should be value rounded, e.g. 100 will round to hundreds, 1000 will round the value to thousands etc, default 0 |
| css | Any custom CSS string |
| cssMinusIcon | CSS class for the minus icon, defaults to fa fa-minus |
| cssMinusButton | CSS class for the minus button, defaults to bg-light (gray background in BS4) |
| cssPlusIcon | CSS class for the plus icon, defaults to fa fa-plus |
| cssPlusButton | CSS class for the plus button, defaults to bg-light |
| cssUnitBg | CSS class for the unit background color, defaults to bg-light |
License
This extension is open source and licensed under BSD-3-Clause (same as Yii2 framework).
Switching from BS3 to BS 4 - since 1.1.0
If you are using this widget for BS3, after upgrading to 1.1.0+ please set proper bootstrap version attribute bsVersion = 3 - see example above.
Changelog
- 1.1.1 - [18.07.2023] Minor fixes to PHP 8.2+
- 1.1.0 - [26.02.2020] Added default support for BS4, fixed validation for 0, minor theming enhancements
- 1.0.2 - [13.09.2018] Fixed namespace
- 1.0.0 - [13.09.2018] Initial release
lubosdz/yii2-ui-range-plus-minus 适用场景与选型建议
lubosdz/yii2-ui-range-plus-minus 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 804 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 09 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ui」 「bootstrap」 「input」 「widget」 「yii2」 「input number」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lubosdz/yii2-ui-range-plus-minus 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lubosdz/yii2-ui-range-plus-minus 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lubosdz/yii2-ui-range-plus-minus 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Yii2 map input widget. Allows you to select geographcal coordinates via a human-friendly inteface.
Widget to add a remaining character counter to text inputs and textareas
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
Native (browser) color input field for SilverStripe
Integration bundle for Aura.Input with Aura.Filter
Views for the package MedicOneSystems Livewire Datatables with Bootstrap 4
统计信息
- 总下载量: 804
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2018-09-13