Completed
Push — master ( 759acc...6a33ec )
by Denis
01:29
created

AbstractLayout::getElementClasses()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Ngtfkx\Laradeck\FormBuilder\Layouts;
4
5
6
abstract class AbstractLayout
7
{
8
    /**
9
     * @var string $cssFramework Тип верстки. Допустимые значения: html, bootstrap3, bootstrap4
10
     */
11
    protected $cssFramework;
12
13
    /**
14
     * @var string $orientation Тип верстки формы
15
     */
16
    protected $orientation;
17
18
    /**
19
     * @var string $formClasses Классы, которые надо назначить на форму
20
     */
21
    protected $formClasses = '';
22
23
    protected $elementClasses = '';
24
25
    protected $orientationDir;
26
27
    abstract protected function setFormClasses();
28
29
    /**
30
     * AbstractLayout constructor.
31
     */
32
    public function __construct()
33
    {
34
35
    }
36
37
    public function orientation(?string $orientation = null): self
38
    {
39
        $this->orientation = $orientation;
40
41
        $this->setFormClasses();
42
43
        return $this;
44
    }
45
46
    public function getViewsDirPath(): string
47
    {
48
        return $this->cssFramework . '.' . $this->orientationDir;
49
    }
50
51
    public function getFormClasses(): string
52
    {
53
        return $this->formClasses;
54
    }
55
56
    public function getElementClasses(): string
57
    {
58
        return $this->elementClasses;
59
    }
60
61
}