/** * Returns the HTML code of tag. * * @return string */ public function render() { $attributes = $this->getArrayCopy(); if ($this->_ignored) { $attributes = array_diff_key($attributes, $this->_ignored); } if ($this->_empty === FALSE and $this->_html) { $value = '<' . $this->_tag . HTML::attributes($attributes) . '>' . (string) $this->_html . '</' . $this->_tag . '>'; } elseif ($this->_empty === FALSE and $this->_cdata) { if (strpos($this->_cdata, "\n") !== FALSE) { $value = '<' . $this->_tag . HTML::attributes($attributes) . ">\n" . "// <![CDATA[\n" . (string) $this->_cdata . "\n" . "// ]]>\n" . '</' . $this->_tag . '>'; } else { $value = '<' . $this->_tag . HTML::attributes($attributes) . '>' . '/* <![CDATA[ */ ' . (string) $this->_cdata . ' /* ]]> */' . '</' . $this->_tag . '>'; } } elseif ($this->_short === TRUE) { // Short form of tag $value = '<' . $this->_tag . HTML::attributes($attributes) . ' />'; } else { // Full form of tag $value = '<' . $this->_tag . HTML::attributes($attributes) . '></' . $this->_tag . '>'; } return $this->_condition ? Ku_HTML::conditional_comments($this->_condition, $value) : $value; }