3 * THtmlElement class file.
5 * @author Qiang Xue <qiang.xue@gmail.com>
6 * @link https://github.com/pradosoft/prado
7 * @copyright Copyright © 2005-2016 The PRADO Group
8 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9 * @package System.Web.UI.WebControls
12 Prado::using('System.Web.UI.WebControls.TWebControl');
17 * THtmlElement represents a generic HTML element whose tag name is specified
18 * via {@link setTagName TagName} property. Because THtmlElement extends from
19 * {@link TWebControl}, it enjoys all its functionalities.
21 * To change the default tag your subclass should override {@link getDefaultTagName}
23 * @author Qiang Xue <qiang.xue@gmail.com>
24 * @author Brad Anderson <javalizard@gmail.com>
25 * @package System.Web.UI.WebControls
28 class THtmlElement extends TWebControl
31 * @var the tag of this element
33 private $_tagName=null;
36 * @return string the tag name of this control. Defaults to 'span'.
38 public function getTagName()
40 return ($this->_tagName !== null) ? $this->_tagName : ($this->_tagName = $this->getDefaultTagName());
44 * @param string the tag name of this control.
46 public function setTagName($value)
48 $this->_tagName=TPropertyValue::ensureString($value);
52 * This is the default tag when no other is specified
53 * @return string the default tag
55 public function getDefaultTagName() {
60 * This tells you if this TagName has deviated from the original
61 * @return boolean true if TagName has deviated from the default.
63 public function getIsMutated() {
64 return $this->_tagName !== null && $this->_tagName != $this->getDefaultTagName();