‪TYPO3CMS  9.5
PasswordViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
32 {
36  protected ‪$tagName = 'input';
37 
41  public function ‪initializeArguments()
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('size', 'int', 'The size of the input field');
57  $this->registerArgument(
58  'errorClass',
59  'string',
60  'CSS class to set if there are errors for this ViewHelper',
61  false,
62  'f3-form-error'
63  );
64  $this->registerUniversalTagAttributes();
65  }
66 
72  public function ‪render()
73  {
74  $name = $this->‪getName();
77 
78  $this->tag->addAttribute('type', 'password');
79  $this->tag->addAttribute('name', $name);
80  $this->tag->addAttribute('value', $this->‪getValueAttribute());
81 
84 
85  return $this->tag->render();
86  }
87 }
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper\setErrorClassAttribute
‪setErrorClassAttribute()
Definition: AbstractFormFieldViewHelper.php:324
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper\setRespectSubmittedDataValue
‪setRespectSubmittedDataValue($respectSubmittedDataValue)
Definition: AbstractFormFieldViewHelper.php:73
‪TYPO3\CMS\Fluid\ViewHelpers\Form
Definition: AbstractFormFieldViewHelper.php:2
‪TYPO3\CMS\Fluid\ViewHelpers\Form\PasswordViewHelper
Definition: PasswordViewHelper.php:32
‪TYPO3\CMS\Fluid\ViewHelpers\Form\PasswordViewHelper\render
‪string render()
Definition: PasswordViewHelper.php:71
‪TYPO3\CMS\Fluid\ViewHelpers\Form\PasswordViewHelper\initializeArguments
‪initializeArguments()
Definition: PasswordViewHelper.php:40
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewHelper\registerFieldNameForFormTokenGeneration
‪registerFieldNameForFormTokenGeneration($fieldName)
Definition: AbstractFormViewHelper.php:101
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper
Definition: AbstractFormFieldViewHelper.php:26
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper\addAdditionalIdentityPropertiesIfNeeded
‪addAdditionalIdentityPropertiesIfNeeded()
Definition: AbstractFormFieldViewHelper.php:239
‪TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper\getName
‪string getName()
Definition: AbstractFormFieldViewHelper.php:86
‪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:35