Passed
Branch ops-updates (277b44)
by Björn
05:09
created

UserDataForm   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 33
c 1
b 0
f 0
dl 0
loc 52
ccs 0
cts 11
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 50 1
1
<?php
2
/**
3
 * BB's Zend Framework 2 Components
4
 * 
5
 * AdminModule
6
 *
7
 * @package   [MyApplication]
8
 * @package   BB's Zend Framework 2 Components
9
 * @package   AdminModule
10
 * @author    Björn Bartels <[email protected]>
11
 * @link      https://gitlab.bjoernbartels.earth/groups/zf2
12
 * @license   http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
13
 * @copyright copyright (c) 2016 Björn Bartels <[email protected]>
14
 */
15
16
namespace Admin\Form;
17
18
use Zend\Form\Form;
19
20
class UserDataForm extends Form
21
{
22
    public function __construct($name = null)
23
    {
24
        // we want to ignore the name passed
25
        parent::__construct('userdata');
26
        $this->setAttribute('method', 'post');
27
        $this->add(
28
            array(
29
            'name' => 'user_id',
30
            'attributes' => array(
31
            'type'  => 'hidden',
32
            ),
33
            )
34
        );
35
        
36
        $this->add(
37
            array(
38
            'name' => 'display_name',
39
            'attributes' => array(
40
            'type'  => 'text',
41
            ),
42
            'options' => array(
43
            'label' => 'Display Name',
44
            ),
45
            )
46
        );
47
        
48
        $this->add(
49
            array(
50
            'name' => 'submit',
51
            'attributes' => array(
52
            'type'  => 'submit',
53
            'value' => 'save',
54
            'id' => 'submitbutton',
55
            ),
56
            'options' => array(
57
            'label' => 'save',
58
            ),
59
            )
60
        );
61
        
62
        $this->add(
63
            array(
64
            'name' => 'reset',
65
            'attributes' => array(
66
            'type'  => 'reset',
67
            'value' => 'reset',
68
            'id' => 'resetbutton',
69
            ),
70
            'options' => array(
71
            'label' => 'reset',
72
            ),
73
            )
74
        );
75
    }
76
}