Completed
Push — master ( d1a379...3c62fa )
by Costin
01:22
created

Submit::setDefaultClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace SoareCostin\BladeFormComponents\FormElements;
4
5
use SoareCostin\BladeFormComponents\FormElement;
6
7
class Submit extends FormElement
8
{
9
    /** @var array */
10
    public $attributesList = [
11
        'class', 'disabled'
12
    ];
13
14
    protected function setLabel()
15
    {
16
        parent::setLabel();
17
18
        if (is_null($this->label)) {
19
            $this->label = is_null($this->model) ? 'Create' : 'Edit';
20
        }
21
    }
22
    
23
    protected function setDefaultClass()
24
    {
25
        // Specific to Bootstrap, we need to add it to config
26
        $this->class[] = 'btn btn-primary';
27
    }
28
}
29