Property | Type | Description | |
---|---|---|---|
$_cssMinifier | |||
$_isXhtml | |||
$_jsCleanComments | boolean | ||
$_jsMinifier | |||
$_placeholders | |||
$_replacementHash |
Method | Description | |
---|---|---|
__construct ( string $html, array $options = [] ) | Create a minifier object | |
minify ( string $html, array $options = [] ) : string | "Minify" an HTML page | |
process ( ) : string | Minify the markeup given in the constructor |
Method | Description | |
---|---|---|
_commentCB ( $m ) | ||
_needsCdata ( $str ) | ||
_removeCdata ( $str ) | ||
_removePreCB ( $m ) | ||
_removeScriptCB ( $m ) | ||
_removeStyleCB ( $m ) | ||
_removeTextareaCB ( $m ) | ||
_reservePlace ( $content ) |
public __construct ( string $html, array $options = [] ) | ||
$html | string | |
$options | array | 'cssMinifier' : (optional) callback function to process content of STYLE elements. 'jsMinifier' : (optional) callback function to process content of SCRIPT elements. Note: the type attribute is ignored. 'jsCleanComments' : (optional) whether to remove HTML comments beginning and end of script block 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If unset, minify will sniff for an XHTML doctype. |
public static minify ( string $html, array $options = [] ) : string | ||
$html | string | |
$options | array | 'cssMinifier' : (optional) callback function to process content of STYLE elements. 'jsMinifier' : (optional) callback function to process content of SCRIPT elements. Note: the type attribute is ignored. 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If unset, minify will sniff for an XHTML doctype. |
return | string |