1 | <?php |
||
5 | abstract class Element implements \hemio\html\Interface_\HtmlCode, \hemio\html\Interface_\MaintainsAppendages, |
||
6 | \hemio\html\Interface_\ElementTag |
||
7 | { |
||
8 | |||
9 | use \hemio\html\Trait_\AppendageMaintainance, |
||
10 | \hemio\html\Trait_\HooksToString; |
||
11 | /** |
||
12 | * parent element in DOM or something similar |
||
13 | * @var \hemio\html\Interface_\MaintainsChilds |
||
14 | */ |
||
15 | public $objParent = null; |
||
16 | |||
17 | /** |
||
18 | * atributes like 'type' => 'text' in <input type="text" /> |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $arrAttributes = array(); |
||
22 | |||
23 | /** |
||
24 | * activated CSS classes like 'my_css_class' => true |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $arrCssClasses = array(); |
||
28 | |||
29 | /** |
||
30 | * concrete CSS options like 'color'=>'green' (please prefer CSS classes!) |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $arrCssPropertys = array(); |
||
34 | |||
35 | /** |
||
36 | * sets an antribute |
||
37 | * @param string $strKey |
||
38 | * @param mixed $mixValue |
||
39 | */ |
||
40 | public function setAttribute($strKey, $mixValue) |
||
49 | |||
50 | /** |
||
51 | * |
||
52 | * @param string $strKey |
||
53 | */ |
||
54 | public function getAttribute($strKey) |
||
59 | |||
60 | /** |
||
61 | * @param string $strClassName |
||
62 | */ |
||
63 | public function addCssClass($strClassName) |
||
69 | |||
70 | /** |
||
71 | * |
||
72 | * @param string $strClassName |
||
73 | */ |
||
74 | public function removeCssClass($strClassName) |
||
80 | |||
81 | /** |
||
82 | * @param string $strKey |
||
83 | * @param mixed $mixValue |
||
84 | */ |
||
85 | public function setCssProperty($strKey, $mixValue) |
||
89 | |||
90 | /** |
||
91 | * @param string $strId |
||
92 | */ |
||
93 | public function setId($strId) |
||
97 | |||
98 | /** |
||
99 | * writes the style collected css styles and classes into the style atribute |
||
100 | */ |
||
101 | protected function generateStyleAttribute() |
||
121 | |||
122 | /** |
||
123 | * Returns what deemed to be the final atributes string |
||
124 | * @return string |
||
125 | */ |
||
126 | protected function getFormattedElementAttributes() |
||
142 | |||
143 | /** |
||
144 | * Sets the parent HTML element. |
||
145 | * Will be called while iterrating through __toString() |
||
146 | * @param \hemio\html\Interface_\MaintainsChilds $objParent |
||
147 | */ |
||
148 | public function setParent(\hemio\html\Interface_\MaintainsChilds $objParent) |
||
152 | |||
153 | public function describe() |
||
157 | } |
||
158 |