TYPO3 CMS  TYPO3_6-2
PasswordViewHelper.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License, either version 3 *
9  * of the License, or (at your option) any later version. *
10  * *
11  * The TYPO3 project - inspiring people to share! *
12  * */
13 
29 
33  protected $tagName = 'input';
34 
41  public function initializeArguments() {
42  parent::initializeArguments();
43  $this->registerTagAttribute('disabled', 'string', 'Specifies that the input element should be disabled when the page loads');
44  $this->registerTagAttribute('maxlength', 'int', 'The maxlength attribute of the input field (will not be validated)');
45  $this->registerTagAttribute('readonly', 'string', 'The readonly attribute of the input field');
46  $this->registerTagAttribute('size', 'int', 'The size of the input field');
47  $this->registerArgument('errorClass', 'string', 'CSS class to set if there are errors for this view helper', FALSE, 'f3-form-error');
49  }
50 
57  public function render() {
58  $name = $this->getName();
60 
61  $this->tag->addAttribute('type', 'password');
62  $this->tag->addAttribute('name', $name);
63  $this->tag->addAttribute('value', $this->getValue());
64 
65  $this->setErrorClassAttribute();
66 
67  return $this->tag->render();
68  }
69 }
registerTagAttribute($name, $type, $description, $required=FALSE, $default=NULL)
registerArgument($name, $type, $description, $required=FALSE, $defaultValue=NULL)