muvo/yii2-slider

There is no license information available for the latest version (dev-master) of this package.

HTML widget extension for Yii2 based on bootstrap-slider

Installs: 352

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2016-10-24 00:00 UTC

This package is not auto-updated.

Last update: 2024-04-23 19:15:54 UTC


README

An extension for Yii2

Installing

~$ composer require muvo/yii2-slider "*"

or add following string in your composer.json into require section:

	"muvo/yii2-slider": "*"

then do

~$ composer update

Usage

After successful install you can use a slider as general widget in your view-files, for example:

    <div>
        <?=\muvo\yii\slider\Widget::widget([
            'name' => 'call_intensity',
            'value' => $predefined_value,
            'sliderOptions' => [
                'min' => 0.5,
                'max' => 8,
                'step' => 0.5,
            ],
        ])?>
    </div>

If you don't want to use a native boottrap assets (for example, you theme/layout already has pre-defined bootstrap), you can add useNativeBootstrap option to your widget:

<div class="col-sm-8">
    <?=\muvo\yii\slider\Widget::widget([
        'useNativeBootstrap' => false,
            'name' => 'call_intensity',
            'value' => $predefined_value,
        …
    ])?>
</div>

Options for widget

Available options, to be passed for config widget:

  • id ID for widget, will be passed to HTML-tag of widget
  • name HTML «name» attribute for HTML-input tag
  • value Predefined value for HTML-input
  • sliderOptions Array with config options, supported by slider-bootstrap

Credits

Vladislav Muschinskikh i@unixoid.su © 2016