ButtonGroup::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
/*
4
 * To change this license header, choose License Headers in Project Properties.
5
 * To change this template file, choose Tools | Templates
6
 * and open the template in the editor.
7
 */
8
9
namespace hemio\form;
10
11
use hemio\html;
12
13
/**
14
 * Groups a bunch of buttons
15
 *
16
 * @since 1.0
17
 */
18
class ButtonGroup extends html\Fieldset {
19
20
    /**
21
     * 
22
     * @param array $buttons
23
     */
24
    public function __construct(array $buttons = []) {
25
        $this->addInheritableAppendage(
26
                FormPost::FORM_FIELD_TEMPLATE, new template\FormPlainControl()
27
        );
28
29
        foreach ($buttons as $button) {
30
            $this[$button->getName()] = $button;
31
        }
32
    }
33
34
}
35