Exemplo n.º 1
0
 /**
  * Render a compound (block) element
  *
  * @param   Compound $compound The compound
  *
  * @return  integer Number of bytes written to the output
  */
 public function visitCompound(Compound $compound)
 {
     $id = " id=\"{$compound->getId()}\"";
     $class = $compound->getParameter('class', '');
     if (!empty($class)) {
         $class = " class=\"{$class}\"";
     }
     $len = 0;
     $len += $this->write("<!-- Compound -->\n");
     $len += $this->write("<{$compound->getType()}{$id}{$class}>\n");
     foreach ($compound->elements as $item) {
         $len += $item->accept($this);
     }
     $len += $this->write("</{$compound->getType()}>\n");
     $len += $this->write("<!-- /Compound -->\n");
     return $len;
 }