1: <?php
2: /**
3: * This file contains the cHTMLHiddenField class.
4: *
5: * @package Core
6: * @subpackage GUI_HTML
7: * @version SVN Revision $Rev:$
8: *
9: * @author Simon Sprankel
10: * @copyright four for business AG <www.4fb.de>
11: * @license http://www.contenido.org/license/LIZENZ.txt
12: * @link http://www.4fb.de
13: * @link http://www.contenido.org
14: *
15: */
16:
17: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
18:
19: /**
20: * cHTMLHiddenField class represents a hidden form field.
21: *
22: * @package Core
23: * @subpackage GUI_HTML
24: */
25: class cHTMLHiddenField extends cHTMLFormElement {
26:
27: /**
28: * Constructor.
29: * Creates an HTML hidden field.
30: *
31: * @param string $name Name of the element
32: * @param string $value Title of the button
33: * @param string $id ID of the element
34: * @return void
35: */
36: public function __construct($name, $value = '', $id = '') {
37: parent::__construct($name, $id);
38: $this->_contentlessTag = true;
39: $this->updateAttribute('type', 'hidden');
40: $this->_tag = 'input';
41:
42: $this->setValue($value);
43: }
44:
45: /**
46: * Sets the value for the field
47: *
48: * @param string $value Value of the field
49: * @return cHTMLHiddenField $this
50: */
51: public function setValue($value) {
52: $this->updateAttribute('value', $value);
53:
54: return $this;
55: }
56:
57: }
58: