ProCacheMinifyHTML class

Copyright (C) 2023 by Ryan Cramer

This is a commercially licensed and supported module DO NOT DISTRIBUTE


Click any linked item for full usage details and examples. Hookable methods are indicated with the icon.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
ProCacheMinifyHTML::convertURLs(string $html, string $rootURL, string $currentURL)
NoneConvert URLs from absolute to relative where shorter 
ProCacheMinifyHTML::getOption($name)
null boolGet the value for an option 
ProCacheMinifyHTML::getOptions()
arrayGet the current set options in key => value array 
ProCacheMinifyHTML::minify($html)
None 
ProCacheMinifyHTML::minifyInlineCSS(string $html)
intMinify a CSS string, for inline CSS minification 
ProCacheMinifyHTML::minifyInlineJS(string $html)
intMinify inline javascript within an HTML document 
ProCacheMinifyHTML::setBlocks($blocks)
$thisSet the block level elements (whitespace removed around these elements) 
ProCacheMinifyHTML::setCSSMinifyFunction(callable $func)
$thisSet the CSS minify callback function 
ProCacheMinifyHTML::setIgnoreTags($tags)
$thisSet the tags that should be ignored 
ProCacheMinifyHTML::setJSMinifyFunction(callable $func)
$thisSet the javascript minify callback function 
ProCacheMinifyHTML::setOption(string $name, bool $value)
$thisSet a minify option 
ProCacheMinifyHTML::setOptions(array $options)
$thisSet multiple options at once in key => value array 
ProCacheMinifyHTML::setRemoveBlankAttrs($attributes)
$thisAttribute names that will be removed when blank 

Properties

NameReturnSummaryDefault
ProCacheMinifyHTML::blankAttrs string array Attributes that may be removed when blank see _construct method
ProCacheMinifyHTML::blocks string array Tags that we will collapse whitespace around see _construct method
ProCacheMinifyHTML::collapseBooleanAttr bool Collapse boolean attributes, where allowed by HTML5? true
ProCacheMinifyHTML::convertXHTML bool Convert XHTML style "/>" closing tags to HTML ">"? true
ProCacheMinifyHTML::cssMinifyFunction callable Function to use for CSS minification null
ProCacheMinifyHTML::ignoreTags string array Tags that should be ignored during minification see _construct method
ProCacheMinifyHTML::jsminifyFunction callable Function to use for JS minification null
ProCacheMinifyHTML::removeBlankAttr bool Remove blank attributes, where allowed? (configurable, default=true) 
ProCacheMinifyHTML::removeComments bool Remove HTML comments? true
ProCacheMinifyHTML::removeUnnecessaryAttr bool Remove unnecessary/redundant attributes from HTML tags? true
ProCacheMinifyHTML::removeUnnecessaryTags bool Remove unnecessary/redundant HTML tags? true
ProCacheMinifyHTML::unquoteAttr bool Remove quotes from attributes, where allowed by HTML5? true

API reference based on ProcessWire core version 3.0.251