| @@ 56-76 (lines=21) @@ | ||
| 53 | /** |
|
| 54 | * @return \Nette\Application\UI\Form |
|
| 55 | */ |
|
| 56 | protected function createComponentForm(): Form |
|
| 57 | { |
|
| 58 | $form = new Form(); |
|
| 59 | ||
| 60 | $form->setTranslator($this->getPrefixedTranslator()); |
|
| 61 | ||
| 62 | $form->addText('email', 'email.field') |
|
| 63 | ->setRequired('email.required') |
|
| 64 | ->addRule($form::EMAIL, 'email.rule') |
|
| 65 | ->setHtmlAttribute('autocomplete', 'username'); |
|
| 66 | ||
| 67 | $form->addProtection('protection.rule'); |
|
| 68 | ||
| 69 | $form->onSuccess[] = [ $this, 'processForm' ]; |
|
| 70 | ||
| 71 | $this->onFormCreation($form); |
|
| 72 | ||
| 73 | $form->addSubmit('send', 'send.field'); |
|
| 74 | ||
| 75 | return $form; |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * @internal |
|
| @@ 98-117 (lines=20) @@ | ||
| 95 | /** |
|
| 96 | * @return \Nette\Application\UI\Form |
|
| 97 | */ |
|
| 98 | protected function createComponentForm(): Form |
|
| 99 | { |
|
| 100 | $form = new Form(); |
|
| 101 | ||
| 102 | $form->setTranslator($this->getPrefixedTranslator()); |
|
| 103 | ||
| 104 | $form->addPassword('password', 'password.field') |
|
| 105 | ->setRequired('password.required') |
|
| 106 | ->setHtmlAttribute('autocomplete', 'new-password'); |
|
| 107 | ||
| 108 | $form->addProtection('protection.rule'); |
|
| 109 | ||
| 110 | $form->onSuccess[] = [$this, 'processForm']; |
|
| 111 | ||
| 112 | $this->onFormCreation($form); |
|
| 113 | ||
| 114 | $form->addSubmit('send', 'send.field'); |
|
| 115 | ||
| 116 | return $form; |
|
| 117 | } |
|
| 118 | ||
| 119 | /** |
|
| 120 | * @internal |
|