Ejemplo n.º 1
0
 /**
  * Returns the string representation
  *
  * @return string
  */
 public function __toString()
 {
     try {
         $templateRootElement = $this->getDocumentElement();
         foreach ($templateRootElement->attributes as $name => $attribute) {
             if ('noNamespaceSchemaLocation' === $name) {
                 $this->getDocumentElement()->removeAttributeNode($attribute);
                 break;
             }
         }
         $templateRootElement->removeAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi');
         $this->compiler->compile($templateRootElement, $this->component, $this->component);
         $this->appendLayoutConfiguration();
         $result = $this->compiler->postprocessing($this->template->__toString());
     } catch (\Exception $e) {
         $result = '';
     }
     return $result;
 }