1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014
* @package yii2-widgets
* @subpackage yii2-widget-rangeinput
* @version 1.0.1
*/
namespace kartik\range;
use Yii;
use yii\helpers\Html;
/**
* RangeInput widget is an enhanced widget encapsulating the HTML 5 range input.
*
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @since 1.0
* @see http://twitter.github.com/typeahead.js/examples
*/
class RangeInput extends \kartik\base\Html5Input
{
public $type = 'range';
public $orientation;
/**
* @inherit doc
*/
public function run() {
if ($this->orientation == 'vertical') {
Html::addCssClass($this->containerOptions, 'kv-range-vertical');
$this->html5Options['orient'] = 'vertical';
}
parent::run();
}
}