[~FEATURE] Fluid (ViewHelpers): Adjusted AbstractFormViewHelper to be able to namespa...
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / ViewHelpers / Form / HiddenViewHelper.php
1 <?php
2
3 /* *
4 * This script belongs to the FLOW3 package "Fluid". *
5 * *
6 * It is free software; you can redistribute it and/or modify it under *
7 * the terms of the GNU Lesser General Public License as published by the *
8 * Free Software Foundation, either version 3 of the License, or (at your *
9 * option) any later version. *
10 * *
11 * This script is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser *
14 * General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with the script. *
18 * If not, see http://www.gnu.org/licenses/lgpl.html *
19 * *
20 * The TYPO3 project - inspiring people to share! *
21 * */
22
23 /**
24 * Renders an <input type="hidden" ...> tag.
25 *
26 * = Examples =
27 *
28 * <code title="Example">
29 * <f:hidden name="myHiddenValue" value="42" />
30 * </code>
31 *
32 * Output:
33 * <input type="hidden" name="myHiddenValue" value="42" />
34 *
35 * You can also use the "property" attribute if you have bound an object to the form.
36 * See <f:form> for more documentation.
37 *
38 * @version $Id: HiddenViewHelper.php 2813 2009-07-16 14:02:34Z k-fish $
39 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
40 * @scope prototype
41 */
42 class Tx_Fluid_ViewHelpers_Form_HiddenViewHelper extends Tx_Fluid_ViewHelpers_Form_AbstractFormFieldViewHelper {
43
44 /**
45 * @var string
46 */
47 protected $tagName = 'input';
48
49 /**
50 * Initialize the arguments.
51 *
52 * @return void
53 * @author Sebastian Kurfürst <sebastian@typo3.org>
54 * @api
55 */
56 public function initializeArguments() {
57 parent::initializeArguments();
58 $this->registerUniversalTagAttributes();
59 }
60
61 /**
62 * Renders the hidden field.
63 *
64 * @return string
65 * @author Sebastian Kurfürst <sebastian@typo3.org>
66 * @api
67 */
68 public function render() {
69 $this->tag->addAttribute('type', 'hidden');
70 $this->tag->addAttribute('name', $this->getName());
71 $this->tag->addAttribute('value', $this->getValue());
72
73 return $this->tag->render();
74 }
75 }
76
77
78 ?>