ruskid/yii2-nouislider
Composer 安装命令:
composer require ruskid/yii2-nouislider
包简介
Yii2 noUiSlider Wrapper
关键字:
README 文档
README
Installation
The preferred way to install this extension is through http://getcomposer.org/download/.
Either run
php composer.phar require ruskid/yii2-nouislider "dev-master"
or add
"ruskid/yii2-nouislider": "dev-master"
to the require section of your composer.json file.
Usage
- Check http://refreshless.com/nouislider/ for options.
- Check https://refreshless.com/nouislider/events-callbacks/ for events.
Main Slider
Can be configured the way you want. This slider is very simple it doesn't do anything special. You need to define your own event handlers if you want to update the hidden input's value on change, slide or update etc.
use ruskid\nouislider\Slider; echo $form->field($model, 'price')->widget(Slider::className(), [ 'pluginOptions' => [ 'start' => [20], 'connect' => false, 'range' => [ 'min' => 0, 'max' => 100 ] ] ]); echo Slider::widget([ 'name' => 'test', 'value' => 50, 'events' => [ Slider::NOUI_EVENT_CHANGE => new \yii\web\JsExpression('function( values, handle ) {' . ' alert("changed"); }'), Slider::NOUI_EVENT_START => new \yii\web\JsExpression('function( values, handle ) {' . ' alert("start sliding"); }'), Slider::NOUI_EVENT_END => new \yii\web\JsExpression('function( values, handle ) {' . ' alert("end sliding"); }'), Slider::NOUI_EVENT_UPDATE => new \yii\web\JsExpression('function( values, handle ) {' . ' alert("updated"); }'), Slider::NOUI_EVENT_SET => new \yii\web\JsExpression('function( values, handle ) {' . ' alert("set"); }'), Slider::NOUI_EVENT_SLIDE => new \yii\web\JsExpression('function( values, handle ) {' . ' alert("slided"); }'), ], 'pluginOptions' => [ 'start' => [20], 'connect' => false, 'range' => [ 'min' => 0, 'max' => 100 ] ] ]);
Sliders with default behavior
You can use some of the sliders inside sliders directory and create your own. Extend Main Slider.
Pull request your sliders!
echo $form->field($model, 'price_min')->widget(OneHandleSlider::className(), [ 'valueContainerId' => 'price_min-container', 'pluginOptions' => [ 'start' => [20], 'connect' => false, 'range' => [ 'min' => 0, 'max' => 100 ] ] ]); echo $form->field($model, 'price_max')->widget(OneHandleSlider::className(), [ 'valueContainerId' => 'price_max-container', 'pluginOptions' => [ 'start' => [20], 'connect' => false, 'range' => [ 'min' => 0, 'max' => 100 ] ] ]); <div>Price min: <span id='price_min-container'></span></div> <div>Price max: <span id='price_max-container'></span></div> echo $form->field($model, 'price')->widget(TwoHandleSlider::className(), [ 'lowerValueContainerId' => 'price_min-container', 'upperValueContainerId' => 'price_max-container', 'pluginOptions' => [ 'start' => [20, 50], 'connect' => false, 'range' => [ 'min' => 0, 'max' => 100 ] ] ]);
ruskid/yii2-nouislider 适用场景与选型建议
ruskid/yii2-nouislider 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.45k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2016 年 05 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「yii2」 「nouislider」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ruskid/yii2-nouislider 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ruskid/yii2-nouislider 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ruskid/yii2-nouislider 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A custom URL rule class for Yii 2 which allows to create translated URL rules
A feature-rich, customizable range slider component for Laravel Livewire applications, built on noUiSlider with Alpine.js integration
SCEditor, a lightweight WYSIWYG BBCode & HTML editor extension for Yii 2.0 Framework
A Filament component for seamlessly integrating NoUiSlider, a highly customizable and lightweight slider library.
Redirect all not authenticated web user to login page.
React javascript library for Yii2
统计信息
- 总下载量: 8.45k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GNU
- 更新时间: 2016-05-14