‪TYPO3CMS  ‪main
PasswordViewHelper.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
35 {
39  protected ‪$tagName = 'input';
40 
41  public function ‪initializeArguments(): void
42  {
43  parent::initializeArguments();
44  $this->registerTagAttribute(
45  'disabled',
46  'string',
47  'Specifies that the input element should be disabled when the page loads'
48  );
49  $this->registerTagAttribute(
50  'maxlength',
51  'int',
52  'The maxlength attribute of the input field (will not be validated)'
53  );
54  $this->registerTagAttribute('placeholder', 'string', 'The placeholder of the textfield');
55  $this->registerTagAttribute('readonly', 'string', 'The readonly attribute of the input field');
56  $this->registerTagAttribute('autocomplete', 'string', 'Specify the autocomplete behaviour for password managers');
57  $this->registerTagAttribute('size', 'int', 'The size of the input field');
58  $this->registerArgument(
59  'errorClass',
60  'string',
61  'CSS class to set if there are errors for this ViewHelper',
62  false,
63  'f3-form-error'
64  );
65  $this->registerUniversalTagAttributes();
66  }
67 
68  public function ‪render(): string
69  {
70  $name = $this->‪getName();
73 
74  $this->tag->addAttribute('type', 'password');
75  $this->tag->addAttribute('name', $name);
76  $this->tag->addAttribute('value', $this->‪getValueAttribute());
77 
80 
81  return $this->tag->render();
82  }
83 }
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper\setErrorClassAttribute
‪setErrorClassAttribute()
Definition: AbstractFormFieldViewHelper.php:331
‪TYPO3\CMS\Fluid\ViewHelpers\Form
Definition: AbstractFormFieldViewHelper.php:18
‪TYPO3\CMS\Fluid\ViewHelpers\Form\PasswordViewHelper
Definition: PasswordViewHelper.php:35
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewHelper\registerFieldNameForFormTokenGeneration
‪registerFieldNameForFormTokenGeneration(string $fieldName)
Definition: AbstractFormViewHelper.php:100
‪TYPO3\CMS\Fluid\ViewHelpers\Form\PasswordViewHelper\initializeArguments
‪initializeArguments()
Definition: PasswordViewHelper.php:40
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper\setRespectSubmittedDataValue
‪setRespectSubmittedDataValue(bool $respectSubmittedDataValue)
Definition: AbstractFormFieldViewHelper.php:69
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper\getName
‪getName()
Definition: AbstractFormFieldViewHelper.php:79
‪TYPO3\CMS\Fluid\ViewHelpers\Form\PasswordViewHelper\render
‪render()
Definition: PasswordViewHelper.php:67
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper
Definition: AbstractFormFieldViewHelper.php:37
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper\addAdditionalIdentityPropertiesIfNeeded
‪addAdditionalIdentityPropertiesIfNeeded()
Definition: AbstractFormFieldViewHelper.php:241
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper\getValueAttribute
‪mixed getValueAttribute()
Definition: AbstractFormFieldViewHelper.php:147
‪TYPO3\CMS\Fluid\ViewHelpers\Form\PasswordViewHelper\$tagName
‪string $tagName
Definition: PasswordViewHelper.php:38