PHP Класс pQuery\HtmlFormatter

Used like: format($root); ?>
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$block_elements Determines which elements start on a new line and which function as block
$errors array Errors found during formatting
$indent_string string String that is used to generate correct indenting
$linebreak_string string String that is used to break lines
$options array Other formatting options
$whitespace Determines which characters are considered whitespace

Открытые методы

Метод Описание
__construct ( array $options = [] ) Class constructor
__invoke ( &$node ) Class magic invoke method, performs {@link format()}
format ( &$node ) Formats HTML/Javascript
format_html ( DomNode &$root, boolean $recursive = null ) Formats HTML
minify_html ( DomNode &$root, boolean $strip_comments = true, boolean $recursive = true ) Minifies HTML / removes unneeded whitespace
minify_javascript ( DomNode &$root, string $indent_string = ' ', boolean $wrap_comment = true, boolean $recursive = true ) : boolean | array Minifies javascript using JSMin+

Описание методов

__construct() публичный Метод

Class constructor
public __construct ( array $options = [] )
$options array {@link $options}

__invoke() публичный Метод

Class magic invoke method, performs {@link format()}
public __invoke ( &$node )

format() публичный Метод

Formats HTML/Javascript
См. также: format_html()
public format ( &$node )

format_html() публичный Метод

Formats HTML
public format_html ( DomNode &$root, boolean $recursive = null )
$root DomNode
$recursive boolean

minify_html() статический публичный Метод

Minifies HTML / removes unneeded whitespace
static public minify_html ( DomNode &$root, boolean $strip_comments = true, boolean $recursive = true )
$root DomNode
$strip_comments boolean
$recursive boolean

minify_javascript() статический публичный Метод

Minifies javascript using JSMin+
static public minify_javascript ( DomNode &$root, string $indent_string = ' ', boolean $wrap_comment = true, boolean $recursive = true ) : boolean | array
$root DomNode
$indent_string string
$wrap_comment boolean Wrap javascript in HTML comments ()
$recursive boolean
Результат boolean | array Array of errors on failure, true on succes

Описание свойств

$block_elements публичное свойство

Determines which elements start on a new line and which function as block
public $block_elements

$errors публичное свойство

Errors found during formatting
public array $errors
Результат array

$indent_string публичное свойство

String that is used to generate correct indenting
public string $indent_string
Результат string

$linebreak_string публичное свойство

String that is used to break lines
public string $linebreak_string
Результат string

$options публичное свойство

Other formatting options
public array $options
Результат array

$whitespace публичное свойство

Determines which characters are considered whitespace
public $whitespace