Ejemplo n.º 1
0
 private function printElement(Element $node)
 {
     $out = '<' . $node->getName();
     foreach ($node->getAttributes() as $attribute) {
         $out .= ' ' . $attribute->getName();
         if ($attribute->getValue() !== null) {
             $quotes = $this->printQuotes($attribute->getQuoting());
             $out .= '=' . $quotes . $attribute->getValue() . $quotes;
         }
     }
     if (!$node->getChildren()->isEmpty() || $node->hasClosingTag()) {
         return $out . '>' . $this->printNodes($node->getChildren()) . '</' . $node->getName() . '>';
     } else {
         return $out . '/>';
     }
 }
Ejemplo n.º 2
0
 private function copyChildren(Element $copy)
 {
     foreach ($this->children as $child) {
         if ($child instanceof Element) {
             $copy->getChildren()->append($child->copy());
         } else {
             if ($child instanceof Text) {
                 $copy->getChildren()->append(new Text($child->getText()));
             }
         }
     }
 }
Ejemplo n.º 3
0
 public function animateChildren(Element $element)
 {
     foreach ($element->getChildren() as $child) {
         if (!$child instanceof Element) {
             continue;
         }
         if ($child->getParent()) {
             $this->animate($child);
         }
     }
 }
Ejemplo n.º 4
0
 public function pushText()
 {
     $this->element->getChildren()->append(new Text($this->nextText));
     $this->reset();
 }