andrew72ru/yii2-bootstrap-slider 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

andrew72ru/yii2-bootstrap-slider

最新稳定版本:1.0

Composer 安装命令:

composer require andrew72ru/yii2-bootstrap-slider

包简介

Slider to choose a digit range

README 文档

README

Slider to choose a number range. Based on seiyria/bootstrap-slider

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist andrew72ru/yii2-bootstrap-slider "*"

or add

"andrew72ru/yii2-bootstrap-slider": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

For more information, please visit seiyria/bootstrap-slider.

$form->field($model, 'property')
    ->widget(\andrew72ru\slider\Slider::className(), [
        'min'           => 100,     // Find min value form you model if you want
        'max'           => 1000,    // Find max value form you model if you want
        'value1'        => 150,     // Optional, value to first slider init. Refer to min if not set
        'value2'        => 350,     // Optional, value to second slider init. Refer to max if not set
        'step'          => 1,       // Optional, refer to 1 if not set,
        'options'       => [
            // Avaliable all seiyria/bootstrap-slider options
        ]
        'clientEvents'  => [
            'slide' => 'function(e) {console.log(e)}',
            'slideStart' => 'function(e) {console.log(e)}',
            'slideStop' => 'function(e) {console.log(e)}',
            'change' => 'function(e) {console.log(e)}',
            'slideEnabled' => 'function(e) {console.log(e)}',
            'slideDisabled' => 'function(e) {console.log(e)}',
        ]
    ])

Remember, slider send a 150,200 (comma separated) value to server. Tune you search model to split it or so.

For example

// Value – is a string value of form field 
if(strpos($value, ',') !== false)
    $where = ['between', 'value', explode(',', $value)[0], explode(',', $value)[1]];

统计信息

  • 总下载量: 6.63k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-30