Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }