Completed
Push — master ( 6de3cf...c386e0 )
by Song
03:18
created

Divider::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Encore\Admin\Form\Field;
4
5
use Encore\Admin\Form\Field;
6
7
class Divider extends Field
8
{
9
    protected $title;
10
11
    public function __construct($title = '')
12
    {
13
        $this->title = $title;
14
    }
15
16
    public function render()
17
    {
18
        if (empty($this->title)) {
19
            return '<hr>';
20
        }
21
22
        return <<<HTML
23
<div style="height: 20px; border-bottom: 1px solid #eee; text-align: center;margin-top: 20px;margin-bottom: 20px;">
24
  <span style="font-size: 18px; background-color: #ffffff; padding: 0 10px;">
25
    {$this->title}
26
  </span>
27
</div>
28
HTML;
29
    }
30
}
31