2017 © Pedro Peláez
 

yii2-extension yii2-bootstrap-slider

Slider to choose a digit range

image

andrew72ru/yii2-bootstrap-slider

Slider to choose a digit range

  • Thursday, August 13, 2015
  • by andrew72ru
  • Repository
  • 1 Watchers
  • 0 Stars
  • 352 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

Yii2 Bootstrap Slider

Slider to choose a number range. Based on seiyria/bootstrap-slider, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

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

or add, (*4)

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

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)

For more information, please visit seiyria/bootstrap-slider., (*7)

$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., (*8)

For example, (*9)

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

The Versions

13/08 2015

dev-master

9999999-dev

Slider to choose a digit range

  Sources   Download

MIT

The Requires

 

by Avatar andrew72ru

extension yii2 bootstrap slider

13/08 2015

1.0

1.0.0.0

Slider to choose a digit range

  Sources   Download

MIT

The Requires

 

by Avatar andrew72ru

extension yii2 bootstrap slider

11/08 2015

0.2.3

0.2.3.0

Slider to choose a digit range

  Sources   Download

MIT

The Requires

 

by Avatar andrew72ru

extension yii2 bootstrap slider

04/08 2015

0.2.2

0.2.2.0

Slider to choose a digit range

  Sources   Download

MIT

The Requires

 

by Avatar andrew72ru

extension yii2 bootstrap slider

04/08 2015

0.2.1

0.2.1.0

Slider to choose a digit range

  Sources   Download

MIT

The Requires

 

by Avatar andrew72ru

extension yii2 bootstrap slider

30/07 2015

0.2

0.2.0.0

Slider to choose a digit range

  Sources   Download

MIT

The Requires

 

by Avatar andrew72ru

extension yii2 bootstrap slider