Ejemplo n.º 1
0
 public static function fromHtml($html)
 {
     $dom = new HtmlDomParser();
     $r = $dom->str_get_html($html);
     $nodes = $r->childNodes();
     $node = $nodes[0];
     $element = new Element($node->tag);
     foreach ($node->getAllAttributes() as $key => $value) {
         $element->setAttribute($key, $value);
     }
     $column = new static($element);
     return $column;
 }
Ejemplo n.º 2
0
 public function getPresetContainerHtmlObject()
 {
     $dom = new HtmlDomParser();
     $r = $dom->str_get_html($this->arrayPreset['container']);
     if (is_object($r)) {
         $nodes = $r->childNodes();
         $node = $nodes[0];
         if (is_object($node)) {
             $element = new Element($node->tag);
             foreach ($node->getAllAttributes() as $key => $value) {
                 $element->setAttribute($key, $value);
             }
         }
     }
     if (!isset($element)) {
         $element = new Element('div');
     }
     return $element;
 }
Ejemplo n.º 3
0
 /**
  * @return string
  */
 public function __toString()
 {
     $e = new Element('script');
     $e->type('text/javascript')->src($this->getAssetURL());
     if (count($this->combinedAssetSourceFiles)) {
         $source = '';
         foreach ($this->combinedAssetSourceFiles as $file) {
             $source .= $file . ' ';
         }
         $source = trim($source);
         $e->setAttribute('data-source', $source);
     }
     return (string) $e;
 }