Submittable::setForm()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/*
3
 * Copyright (C) 2015 Michael Herold <[email protected]>
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
namespace hemio\html\Trait_;
20
21
/**
22
 *
23
 * @todo ensure propper name
24
 * @todo description
25
 * @author Michael Herold <[email protected]>
26
 */
27
trait Submittable
28
{
29
30
    /**
31
     * Sets the 'name' attribute
32
     * @param string $name
33
     */
34
    public function setName($name)
35
    {
36
        $this->setAttribute('name', $name);
37
    }
38
39
    /**
40
     * Sets the 'form' attribute. This attribute associates the submittable
41
     * element with the form element with the correspoding name.
42
     *
43
     * @param string $formName
44
     */
45
    public function setForm($formName)
46
    {
47
        $this->setAttribute('form', $formName);
48
    }
49
50
    /**
51
     * @param string $strKey
52
     * @param mixed $mixValue
53
     */
54
    abstract public function setAttribute($strKey, $mixValue);
55
}
56