1: <?php
2:
3: /**
4: * This file contains the cHTMLContentElement class.
5: *
6: * @package Core
7: * @subpackage GUI_HTML
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: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: /**
19: * cHTMLContentElement class represents an element which can contain content.
20: *
21: * @package Core
22: * @subpackage GUI_HTML
23: */
24: class cHTMLContentElement extends cHTML {
25:
26: /**
27: * Constructor to create an instance of this class.
28: *
29: * @param mixed $content [optional]
30: * String or object with the contents
31: * @param string $class [optional]
32: * the class of this element
33: * @param string $id [optional]
34: * the ID of this element
35: */
36: public function __construct($content = '', $class = '', $id = '') {
37: parent::__construct();
38: $this->setContent($content);
39: $this->_contentlessTag = false;
40: $this->setClass($class);
41: $this->setID($id);
42: }
43:
44: /**
45: * Sets the element's content
46: *
47: * @param string|object|array $content
48: * String with the content or a cHTML object to render or an array
49: * of strings / objects.
50: * @return cHTMLContentElement
51: * $this for chaining
52: */
53: public function setContent($content) {
54: return $this->_setContent($content);
55: }
56:
57: /**
58: * Appends code / objects to the content.
59: *
60: * @param string|object|array $content
61: * String with the content or a cHTML object to render
62: * or an array of strings / objects.
63: * @return cHTMLContentElement
64: * $this for chaining
65: */
66: public function appendContent($content) {
67: return $this->_appendContent($content);
68: }
69:
70: }
71: