Total Complexity | 3 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
5 | class InputSlider extends InputGroupComponent |
||
6 | { |
||
7 | /** |
||
8 | * The bootstrap-slider plugin configuration parameters. Array with |
||
9 | * key => value pairs, where the key should be an existing configuration |
||
10 | * property of the plugin. |
||
11 | * |
||
12 | * @var array |
||
13 | */ |
||
14 | public $config; |
||
15 | |||
16 | /** |
||
17 | * The slider color. One of the available html colors. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | public $color; |
||
22 | |||
23 | /** |
||
24 | * Create a new component instance. |
||
25 | * Note this component requires the 'bootstrap-slider' plugin. |
||
26 | * |
||
27 | * @return void |
||
28 | */ |
||
29 | 1 | public function __construct( |
|
30 | $name, $label = null, $size = null, $labelClass = null, |
||
31 | $topClass = null, $disableFeedback = null, $config = [], $color = null |
||
32 | ) { |
||
33 | 1 | parent::__construct( |
|
34 | 1 | $name, $label, $size, $labelClass, $topClass, $disableFeedback |
|
35 | ); |
||
36 | |||
37 | 1 | $this->config = is_array($config) ? $config : []; |
|
38 | 1 | $this->color = $color; |
|
39 | |||
40 | // Set a default plugin 'id' option. |
||
41 | |||
42 | 1 | $this->config['id'] = $this->config['id'] ?? "{$name}-slider"; |
|
43 | 1 | } |
|
44 | |||
45 | /** |
||
46 | * Get the view / contents that represent the component. |
||
47 | * |
||
48 | * @return \Illuminate\View\View|string |
||
49 | */ |
||
50 | 1 | public function render() |
|
53 | } |
||
54 | } |
||
55 |