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