[TASK] Streamline phpdoc annotations in EXT:fluid
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / ViewHelpers / Form / HiddenViewHelper.php
1 <?php
2 namespace TYPO3\CMS\Fluid\ViewHelpers\Form;
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
17 /**
18 * Renders an <input type="hidden" ...> tag.
19 *
20 * = Examples =
21 *
22 * <code title="Example">
23 * <f:form.hidden name="myHiddenValue" value="42" />
24 * </code>
25 * <output>
26 * <input type="hidden" name="myHiddenValue" value="42" />
27 * </output>
28 *
29 * You can also use the "property" attribute if you have bound an object to the form.
30 * See <f:form> for more documentation.
31 */
32 class HiddenViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFieldViewHelper
33 {
34 /**
35 * @var string
36 */
37 protected $tagName = 'input';
38
39 /**
40 * Initialize the arguments.
41 */
42 public function initializeArguments()
43 {
44 parent::initializeArguments();
45 $this->registerUniversalTagAttributes();
46 }
47
48 /**
49 * Renders the hidden field.
50 *
51 * @return string
52 */
53 public function render()
54 {
55 $name = $this->getName();
56 $this->registerFieldNameForFormTokenGeneration($name);
57 $this->setRespectSubmittedDataValue(true);
58
59 $this->tag->addAttribute('type', 'hidden');
60 $this->tag->addAttribute('name', $name);
61 $this->tag->addAttribute('value', $this->getValueAttribute());
62
63 return $this->tag->render();
64 }
65 }