TYPO3 CMS  TYPO3_7-6
PasswordViewHelper.php
Go to the documentation of this file.
1 <?php
2 
4 
5 /* *
6  * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
7  * *
8  * It is free software; you can redistribute it and/or modify it under *
9  * the terms of the GNU Lesser General Public License, either version 3 *
10  * of the License, or (at your option) any later version. *
11  * *
12  * The TYPO3 project - inspiring people to share! *
13  * */
14 
30 {
34  protected $tagName = 'input';
35 
42  public function initializeArguments()
43  {
44  parent::initializeArguments();
45  $this->registerTagAttribute(
46  'disabled', 'string', 'Specifies that the input element should be disabled when the page loads'
47  );
48  $this->registerTagAttribute(
49  'maxlength', 'int', 'The maxlength attribute of the input field (will not be validated)'
50  );
51  $this->registerTagAttribute('readonly', 'string', 'The readonly attribute of the input field');
52  $this->registerTagAttribute('size', 'int', 'The size of the input field');
53  $this->registerArgument(
54  'errorClass', 'string', 'CSS class to set if there are errors for this view helper', false, 'f3-form-error'
55  );
57  }
58 
65  public function render()
66  {
67  $name = $this->getName();
69  $this->setRespectSubmittedDataValue(true);
70 
71  $this->tag->addAttribute('type', 'password');
72  $this->tag->addAttribute('name', $name);
73  $this->tag->addAttribute('value', $this->getValueAttribute());
74 
76  $this->setErrorClassAttribute();
77 
78  return $this->tag->render();
79  }
80 }
registerArgument($name, $type, $description, $required=false, $defaultValue=null)
registerTagAttribute($name, $type, $description, $required=false, $default=null)