UIButton   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 3
1
<?php
2
3
namespace Asymptix\ui\components;
4
5
/**
6
 * UI Button component class.
7
 *
8
 * @category Asymptix PHP Framework
9
 * @author Dmytro Zarezenko <[email protected]>
10
 * @copyright (c) 2009 - 2016, Dmytro Zarezenko
11
 *
12
 * @git https://github.com/Asymptix/Framework
13
 * @license http://opensource.org/licenses/MIT
14
 */
15
class UIButton extends \Asymptix\ui\UIComponent {
16
17
    const DEFAULT_TEMPLATE = "/../templates/components/ui_button.tpl.php";
18
19
    const BTN_RESET = "reset";
20
    const BTN_BUTTON = "button";
21
    const BTN_SUBMIT = "submit";
22
23
    protected $type = self::BTN_BUTTON;
24
25
    protected $isClose = false;
26
27
    public function __construct($attribs = [], $template = null, $show = false) {
28
        if (empty($template)) {
29
            $template = __DIR__ . self::DEFAULT_TEMPLATE;
30
        }
31
32
        if ($show) {
33
            parent::__construct($attribs, $template);
34
        } else {
35
            $this->template = $template;
36
            $this->setAttributes($attribs);
37
        }
38
    }
39
}
40