Passed
Pull Request — 2.x (#1360)
by Harings
11:27
created

Radios::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace A17\Twill\View\Components;
4
5
class Radios extends FieldWithOptions
6
{
7
    public $inline;
8
    public $border;
9
10
    public function __construct(
11
        $name,
12
        $label,
13
        $options = [],
14
        $unpack = false,
15
        $columns = 0,
16
        $searchable = false,
17
        $note = null,
18
        $placeholder = null,
19
        $disabled = false,
20
        $addNew = false,
21
        $moduleName = null,
22
        $default = false,
23
        $storeUrl = null,
24
        $fieldsInModal = null,
25
        $inline = false,
26
        $border = false
27
    ) {
28
        parent::__construct(
29
            $name,
30
            $label,
31
            $options,
32
            $unpack,
33
            $columns,
34
            $searchable,
35
            $note,
36
            $placeholder,
37
            $disabled,
38
            $addNew,
39
            $moduleName,
40
            $storeUrl,
41
            $default,
42
            $fieldsInModal
43
        );
44
45
        $this->inline = $inline;
46
        $this->border = $border;
47
    }
48
49
    public function render()
50
    {
51
        return view('twill::partials.form._radios', [
52
            'options' => $this->getOptions(),
53
            'inModal' => $this->inModal()
54
        ]);
55
    }
56
}
57