-
Notifications
You must be signed in to change notification settings - Fork 5
/
ProfilePasswordForm.php
69 lines (57 loc) · 1.67 KB
/
ProfilePasswordForm.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
declare(strict_types=1);
namespace Frontend\User\Form;
use Frontend\User\InputFilter\ProfilePasswordInputFilter;
use Laminas\Form\Element\Password;
use Laminas\Form\Element\Submit;
use Laminas\Form\Form;
use Laminas\Form\FormInterface;
use Laminas\InputFilter\InputFilterInterface;
/** @template-extends Form<FormInterface> */
class ProfilePasswordForm extends Form
{
protected InputFilterInterface $inputFilter;
public function __construct(mixed $name = null, array $options = [])
{
parent::__construct($name, $options);
$this->init();
$this->inputFilter = new ProfilePasswordInputFilter();
$this->inputFilter->init();
}
public function init(): void
{
parent::init();
$this->add([
'name' => 'password',
'options' => [
'label' => 'Password',
],
'attributes' => [
'placeholder' => 'Password...',
],
'type' => Password::class,
]);
$this->add([
'name' => 'passwordConfirm',
'options' => [
'label' => 'Confirm password',
],
'attributes' => [
'placeholder' => 'Confirm password...',
],
'type' => Password::class,
]);
$this->add([
'name' => 'submit',
'attributes' => [
'type' => 'submit',
'value' => 'Change',
],
'type' => Submit::class,
]);
}
public function getInputFilter(): InputFilterInterface
{
return $this->inputFilter;
}
}