Passed
Pull Request — master (#721)
by Florian
03:05
created

Button::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components;
4
5
use Illuminate\View\Component;
6
7
class Button extends Component
8
{
9
    /**
10
     * The visible label (text) for the button.
11
     *
12
     * @var string
13
     */
14
    public $label;
15
16
    /**
17
     * The button type ('button', 'submit', 'reset'). Similar to the html type
18
     * attribute but with a default value.
19
     *
20
     * @var string
21
     */
22
    public $type;
23
24
    /**
25
     * The button style theme. One of the available AdminLTE theme: primary,
26
     * secondary, info, warning, danger, success, dark, etc.
27
     *
28
     * @var string
29
     */
30
    public $theme;
31
32
    /**
33
     * A fontawesome icon for the button.
34
     *
35
     * @var string
36
     */
37
    public $icon;
38
39
    /**
40
     * Create a new component instance.
41
     *
42
     * @return void
43
     */
44 1
    public function __construct(
45
        $label = 'Button', $type = 'button', $theme = 'default', $icon = null
46
    ) {
47 1
        $this->label = $label;
48 1
        $this->type = $type;
49 1
        $this->theme = $theme;
50 1
        $this->icon = $icon;
51 1
    }
52
53
    /**
54
     * Get the view / contents that represent the component.
55
     *
56
     * @return \Illuminate\View\View|string
57
     */
58 1
    public function render()
59
    {
60 1
        return view('adminlte::components.button');
61
    }
62
}
63