muvo / yii2-slider
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
Requires
- bower-asset/seiyria-bootstrap-slider: *
- yiisoft/yii2: ^2
- yiisoft/yii2-bootstrap: *
This package is not auto-updated.
Last update: 2025-01-28 22:37:51 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 widgetname
HTML «name» attribute for HTML-input tagvalue
Predefined value for HTML-inputsliderOptions
Array with config options, supported by slider-bootstrap
Credits
Vladislav Muschinskikh i@unixoid.su © 2016