/** * (non-PHPdoc) * @see AbstractBbcodeNode::appendText() */ public function appendText($string) { if (($cnt = count($chd = parent::getChildren())) > 0) { $child = $chd[$cnt - 1]; $child->appendText($string); } else { $this->addChild(new TextBbcodeNode($string)); } }
/** * Gets HTML5 compliant string from this subtree. * * @return string */ public function toHtml() { if ($this->isEmpty()) { return ""; } if (count(parent::getChildren()) === 0) { return '<a href="' . $this->e($this->_target_url) . '">' . $this->e($this->_target_url) . '</a>'; } else { return '<a href="' . $this->e($this->_target_url) . '">' . parent::childrenHtml() . '</a>'; } }