pQuery\HtmlFormatter::format PHP 메소드

format() 공개 메소드

Formats HTML/Javascript
또한 보기: format_html()
public format ( &$node )
    function format(&$node)
    {
        $this->errors = array();
        if ($this->options['minify_script']) {
            $a = self::minify_javascript($node, $this->indent_string, true, true);
            if (is_array($a)) {
                foreach ($a as $error) {
                    $this->errors[] = $error[0]->getMessage() . ' >>> ' . $error[1];
                }
            }
        }
        return $this->format_html($node);
    }

Usage Example

예제 #1
0
파일: ganon.php 프로젝트: tburry/pquery
/**
 * Format/beautify DOM
 * @param DomNode $root
 * @param array $options Extra formatting options {@link Formatter::$options}
 * @return bool
 */
function dom_format(&$root, $options = array())
{
    $formatter = new HtmlFormatter($options);
    return $formatter->format($root);
}