Passed
Push — 2.6.0 ( ...f22176 )
by steve
18:56
created

SwitchInput   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 28
rs 10
c 0
b 0
f 0
ccs 0
cts 12
cp 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getComponentDetails() 0 4 1
A registerScripts() 0 3 1
A getFieldHtml() 0 3 1
1
<?php
2
/**
3
 * @link http://www.newicon.net/neon
4
 * @copyright Copyright (c) 21/09/2016 Newicon Ltd
5
 * @license http://www.newicon.net/neon/license/
6
 */
7
8
namespace neon\core\form\fields\el;
9
10
use neon\core\form\fields\el\assets\ElAsset;
11
use neon\core\form\fields\SwitchButton;
12
use neon\core\form\fields\Text;
13
use neon\core\helpers\Arr;
14
use neon\core\helpers\Html;
15
16
class SwitchInput extends SwitchButton
17
{
18
	/**
19
	 * The DDS data type to store the value of the field
20
	 * @var string
21
	 */
22
	public $ddsDataType = 'boolean';
23
24
	public function registerScripts($view)
25
	{
26
		ElAsset::register($view);
27
	}
28
29
	/**
30
	 * @inheritdoc
31
	 */
32
	public function getFieldHtml()
33
	{
34
		return Html::tag('el-switch', '', ['name'=>$this->getInputName()]);
35
	}
36
37
	/**
38
	 * @inheritdoc
39
	 */
40
	public function getComponentDetails()
41
	{
42
		return [
43
			'name' => 'Switch',  'icon' => 'fa fa-toggle-on', 'group' => 'element ui',
44
		];
45
	}
46
47
48
}