@param $html
@param array $options

@return \DOMDocument
554777
public function loadHTML( $html, $options = [] ) {
		$html = '<div><!-- pb_fixme -->' . $html . '<!-- pb_fixme --></div>';
		if ( $this->parser instanceof \DOMDocument ) {
			libxml_use_internal_errors( true );
			$this->parser->loadHTML( mb_convert_encoding( $html, 'HTML-ENTITIES', 'UTF-8' ), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD );
			$this->errors = libxml_get_errors();
			libxml_clear_errors();
			return $this->parser;
		} else {
			return $this->parser->loadHTML( $html, $options );
		}
	}
1075864
public function panelFooter($html, $options = array()) {
                $defaults = array('class' => '');
		$options = array_merge($defaults, $options);
		$options = $this->addClass($options, 'panel-footer');
		return $this->tag('div', $html, $options);
        }
692166
public function tag($name, Array $options = array(), $content = null, $open = false)
    {
        if (!$name) {
            return '';
        }
        $htmlOptions = '';
        foreach ($options as $key => $value) {
            $htmlOptions .= ' ' . $key . '="' . \htmlspecialchars($value, \ENT_COMPAT) . '"';
        }
        if ($content !== null) {
            return '<' . $name . $htmlOptions . '>' . $content . '</' . $name . '>';
        } else {
            return '<' . $name . $htmlOptions . (($open) ? '>' : ' />');
        }
    }
231407
public function getAsHtml($options = [])
    {
        $defaults = [
            'table_id' => null,
            'table_class' => null,
            'translations' => [
                'title' => 'Transaction Details'
            ],
        ];

        $options = array_merge($defaults, $options);
        $translations = $options['translations'];

        $html = "<table id='{$options['table_id']}' class='{$options['table_class']}'><tbody>";
        foreach ($this->getAllSetData() as $key => $value) {
            $html .= "<tr><td>" . $this->translate($key, $translations) . "</td><td>" . $value . "</td></tr>";
        }

        $html .= "</tbody></table>";
        return $html;
    }
648585
public function load(string $str, array $options = []): Dom
    {
        AbstractNode::resetCount();
        // check if it's a file
        if (strpos($str, "\n") === false && is_file($str)) {
            return $this->loadFromFile($str, $options);
        }
        // check if it's a url
        if (preg_match("/^https?:\/\//i", $str)) {
            return $this->loadFromUrl($str, $options);
        }

        return $this->loadStr($str, $options);
    }
630263
public function create($document, $options = null)
    {
        $this->assertProperties($document, ['_type'], 'create');
        return $this->createDocument($document, 'create', $options);
    }
216030
public static function htmlToDomDocument($html)
    {
        if (!$html) {
            $html = '';
        }

        // Transform multibyte entities which otherwise display incorrectly.
        $html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');

        // Internal errors enabled as HTML5 not fully supported.
        libxml_use_internal_errors(true);

        // Instantiate new DOMDocument object, and then load in UTF-8 HTML.
        $dom = new DOMDocument();
        $dom->encoding = 'UTF-8';
        $dom->loadHTML("<div>$html</div>");

        return $dom;
    }
803871
public function button( $value = null, $options = [] ) {
		if ( ! array_key_exists( 'type', $options ) ) {
			$options['type'] = 'button';
		}

		return $this->to_html_string( '<button' . $this->attributes( $options ) . '>' . $value . '</button>' );
	}
271092
public function button($name, $options = array())
    {
        $options += array(
            "type" => "button",
            "label" => "Button",
            "id"    => $this->id($name),
            "name"  => $this->name($name),
        );

        $label = $options["label"];
        unset($options["label"]);

        return sprintf('<button %s>%s</button>', $this->arrayToHtmlAttributes($options), $label);
    }
8594
public function li($element, array $options = [])
    {
        if (!is_array($element)) {
            return self::tag('li', $element, $options);
        }

        $element = array_map(function ($element) use ($options) {
            return self::tag('li', $element, $options);
        }, $element);

        return implode(PHP_EOL, $element);
    }
212816
public function beginWidget($options=[],$tag='div')
    {
        $widget = Html::beginTag($tag,$options);
        $this->_widgets[] = $widget;
        return $widget;
        
    }
561649
public function ueditor($options = [])
    {
        if (! isset($options['rows'])) {
            $options['rows'] = 5;
        }
        $options = array_merge($this->inputOptions, $options);
        $this->adjustLabelFor($options);
        $name = isset($options['name']) ? $options['name'] : Html::getInputName($this->model, $this->attribute);
        if (isset($options['value'])) {
            $value = $options['value'];
            unset($options['value']);
        } else {
            $value = Html::getAttributeValue($this->model, $this->attribute);
        }
        if (! array_key_exists('id', $options)) {
            $options['id'] = Html::getInputId($this->model, $this->attribute);
        }
        //self::normalizeMaxLength($model, $attribute, $options);
        $this->parts['{input}'] = Ueditor::widget(['content' => $value, 'name' => $name, 'id' => $this->attribute]);

        return $this;
    }
728608
private static function buildHtml(&$html, $tag_object, $options, $tab = 0)
    {
        self::checkBuildOptions($options);

        $tag_is_special = in_array($tag_object->getTag(), self::$special_tags);
        $tag_is_ignored = in_array($tag_object->getTag(), array_get($options, 'ignore_tags', []));

        $ignore_tag = true;
        if (!isset($options['ignore_tags']) || !$tag_is_ignored) {
            $ignore_tag = false;
        } elseif (isset($options['ignore_tags']) && $tag_is_ignored) {
            $tab--;
        }

        $pad = '';
        if ($tab > 0) {
            $pad = str_pad($pad, $tab * 2, ' ', STR_PAD_LEFT);
        }

        if (!$ignore_tag) {
            if ($tag_is_special) {
                $html .= $pad.trim((string) $tag_object)."\n";
            } elseif (!$tag_is_special) {
                $html .= $pad;
                $html .= '<'.$tag_object->tag.''.self::buildHtmlAttribute($tag_object->getAttributes()).'>';
                $html .= ($tag_object->use_whitespace) ? "\n" : '';
                if (strlen($tag_object->getText())) {
                    $html .= ($tag_object->use_whitespace) ? $pad.'  ' : '';
                    $html .= $tag_object->getText();
                }
                $html .= ($tag_object->use_whitespace && strlen($tag_object->getText())) ? "\n" : '';
            }
        }

        if (!$tag_is_special && $tag_object->hasChildNodes()) {
            foreach ($tag_object->getChildNodes() as $child_tag_object) {
                self::buildHtml($html, $child_tag_object, $options, $tab + 1);
            }
        }

        $pad = '';
        if ($tab > 0) {
            $pad = str_pad($pad, $tab * 2, ' ', STR_PAD_LEFT);
        }

        if (!$ignore_tag && !$tag_is_special) {
            $html .= ($tag_object->use_whitespace) ? $pad : '';
            $html .= '</'.$tag_object->tag.'>'."\n";
        }
    }
10973
public function html(array $options = array(), array $ns = array()) {
        if ($ns) {
            foreach ($ns as $key => $url) {
                $this->ns($key, $url);
            }
        }

        return $this->Html->tag('html', null, $this->_namespaces + $options);
    }
158542
public function html(array $options = [], array $namespaces = [])
    {
        $this->addNamespace('og', 'http://ogp.me/ns#');
        $this->addNamespace('fb', 'http://ogp.me/ns/fb#');

        if ($namespaces) {
            foreach ($namespaces as $ns => $url) {
                $this->addNamespace($ns, $url);
            }
        }

        $this->setType($this->config('type'));
        $this->setUri($this->request->here);
        $this->setTitle($this->_View->fetch('title'));

        if ($appId = $this->config('app_id')) {
            $this->setAppId($appId);
        }

        return $this->Html->tag('html', null, $this->config('namespaces') + $options);
    }
1068383
public function save(array &$data, array $options = array())
    {
        $document = new Document($data, $this);
        $save = $document->save($options);
        $data = $document->data;

        return $save;
    }
507530
public function HTMLToImage($html, GrabzItImageOptions $options = null)
	{
		if ($options == null)
		{
			$options = new GrabzItImageOptions();			
		}		

		$this->request = new GrabzItRequest($this->getRootUrl(true) . GrabzItClient::TakePicture, true, $options, $html);
	}