public final function toString(Texy $texy) { $ct = $this->getContentType(); $s = $texy->protect($this->startTag(), $ct); if ($this->isEmpty) { return $s; } foreach ($this->children as $child) { if (is_object($child)) { $s .= $child->toString($texy); } else { $s .= $child; } } return $s . $texy->protect($this->endTag(), $ct); }
/** * Renders element's start tag, content and end tag to internal string representation. * @param Texy * @return string */ public final function toString(Texy $texy) { $ct = $this->getContentType(); $s = $texy->protect($this->startTag(), $ct); // empty elements are finished now if ($this->isEmpty) { return $s; } // add content foreach ($this->children as $child) { if (is_object($child)) { $s .= $child->toString($texy); } else { $s .= $child; } } // add end tag return $s . $texy->protect($this->endTag(), $ct); }