1: <?php
2: /*
3: You may not change or alter any portion of this comment or credits
4: of supporting developers from this source code or any supporting source code
5: which is considered copyrighted (c) material of the original comment or credit authors.
6:
7: This program is distributed in the hope that it will be useful,
8: but WITHOUT ANY WARRANTY; without even the implied warranty of
9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: namespace Xoops\Form;
13:
14: /**
15: * Raw - raw form element
16: *
17: * This class has special treatment by xoopsforms, it will render the raw
18: * value provided without wrapping in HTML
19: *
20: * @category Xoops\Form\Raw
21: * @package Xoops\Form
22: * @author trabis <trabisdementia@gmail.com>
23: * @copyright 2012-2015 XOOPS Project (http://xoops.org)
24: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
25: * @link http://xoops.org
26: */
27: class Raw extends Element
28: {
29:
30: /**
31: * __construct
32: *
33: * @param string|array $value raw value to insert into form, or array of attributes
34: */
35: public function __construct($value)
36: {
37: if (is_array($value)) {
38: parent::__construct($value);
39: } else {
40: parent::__construct([]);
41: $this->set('value', $value);
42: }
43: }
44:
45: /**
46: * render
47: *
48: * @return string rendered form element
49: */
50: public function render()
51: {
52: return $this->get('value', '');
53: }
54: }
55: