1 | <?php |
||
8 | class Base extends ProvidesEventsForm |
||
9 | { |
||
10 | public function __construct() |
||
11 | { |
||
12 | parent::__construct(); |
||
13 | |||
14 | $this->add(array( |
||
15 | 'name' => 'username', |
||
16 | 'options' => array( |
||
17 | 'label' => 'Username', |
||
18 | ), |
||
19 | 'attributes' => array( |
||
20 | 'type' => 'text' |
||
21 | ), |
||
22 | )); |
||
23 | |||
24 | $this->add(array( |
||
25 | 'name' => 'email', |
||
26 | 'options' => array( |
||
27 | 'label' => 'Email', |
||
28 | ), |
||
29 | 'attributes' => array( |
||
30 | 'type' => 'text' |
||
31 | ), |
||
32 | )); |
||
33 | |||
34 | $this->add(array( |
||
35 | 'name' => 'display_name', |
||
36 | 'options' => array( |
||
37 | 'label' => 'Display Name', |
||
38 | ), |
||
39 | 'attributes' => array( |
||
40 | 'type' => 'text' |
||
41 | ), |
||
42 | )); |
||
43 | |||
44 | $this->add(array( |
||
45 | 'name' => 'password', |
||
46 | 'type' => 'password', |
||
47 | 'options' => array( |
||
48 | 'label' => 'Password', |
||
49 | ), |
||
50 | 'attributes' => array( |
||
51 | 'type' => 'password' |
||
52 | ), |
||
53 | )); |
||
54 | |||
55 | $this->add(array( |
||
56 | 'name' => 'passwordVerify', |
||
57 | 'type' => 'password', |
||
58 | 'options' => array( |
||
59 | 'label' => 'Password Verify', |
||
60 | ), |
||
61 | 'attributes' => array( |
||
62 | 'type' => 'password' |
||
63 | ), |
||
64 | )); |
||
65 | |||
66 | $submitElement = new Element\Button('submit'); |
||
67 | $submitElement |
||
68 | ->setLabel('Submit') |
||
69 | ->setAttributes(array( |
||
70 | 'type' => 'submit', |
||
71 | )); |
||
72 | |||
73 | $this->add($submitElement, array( |
||
74 | 'priority' => -100, |
||
75 | )); |
||
76 | |||
77 | $this->add(array( |
||
78 | 'name' => 'userId', |
||
79 | 'type' => 'Zend\Form\Element\Hidden', |
||
80 | 'attributes' => array( |
||
81 | 'type' => 'hidden' |
||
82 | ), |
||
83 | )); |
||
84 | |||
85 | // @TODO: Fix this... getValidator() is a protected method. |
||
86 | //$csrf = new Element\Csrf('csrf'); |
||
87 | //$csrf->getValidator()->setTimeout($this->getRegistrationOptions()->getUserFormTimeout()); |
||
88 | //$this->add($csrf); |
||
89 | |||
90 | $this->getEventManager()->trigger('init', $this); |
||
91 | } |
||
92 | |||
93 | public function init() |
||
96 | } |
||
97 |