Innoweb\MinifyHTML\Util\HTMLMinifier
Synopsis
class HTMLMinifier
{
- // members
- private static bool $enable_minification = true;
- private static bool $optimize_via_html_dom_parser = true;
- private static bool $remove_comments = false;
- private static bool $sum_up_whitespace = true;
- private static bool $remove_whitespace_around_tags = true;
- private static bool $optimize_attributes = true;
- private static bool $remove_http_prefix_from_attributes = false;
- private static bool $remove_https_prefix_from_attributes = false;
- private static bool $remove_default_attributes = false;
- private static bool $remove_deprecated_anchor_name = false;
- private static bool $remove_deprecated_script_charset_attribute = false;
- private static bool $remove_deprecated_type_from_script_tag = true;
- private static bool $remove_deprecated_type_from_stylesheet_link = true;
- private static bool $remove_default_media_type_from_style_and_link_tag = false;
- private static bool $remove_default_type_from_button = false;
- private static bool $remove_empty_attributes = true;
- private static bool $remove_value_from_empty_input = true;
- private static bool $sort_css_class_names = true;
- private static bool $sort_html_attributes = true;
- private static bool $remove_spaces_between_tags = false;
- private static bool $remove_omitted_quotes = false;
- private static bool $remove_omitted_html_tags = false;
- // methods
- public static void minify()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
Members
private
- $enable_minification
—
Innoweb\MinifyHTML\Util\bool
Disable all optimisations - $optimize_attributes
—
Innoweb\MinifyHTML\Util\bool
Optimize html attributes - $optimize_via_html_dom_parser
—
Innoweb\MinifyHTML\Util\bool
Optimize html via "HtmlDomParser()" - $remove_comments
—
Innoweb\MinifyHTML\Util\bool
Remove default HTML comments - $remove_default_attributes
—
Innoweb\MinifyHTML\Util\bool
Remove default attributes (disabled by default) - $remove_default_media_type_from_style_and_link_tag
—
Innoweb\MinifyHTML\Util\bool
remove "media="all" from all links and styles (disabled by default) - $remove_deprecated_anchor_name
—
Innoweb\MinifyHTML\Util\bool
Remove deprecated anchor-jump (disabled by default) - $remove_deprecated_script_charset_attribute
—
Innoweb\MinifyHTML\Util\bool
Remove deprecated charset-attribute - the browser will use the charset from the HTTP-Header, anyway (disabled by default) - $remove_deprecated_type_from_script_tag
—
Innoweb\MinifyHTML\Util\bool
Remove deprecated script-mime-types - $remove_deprecated_type_from_stylesheet_link
—
Innoweb\MinifyHTML\Util\bool
Remove "type=text/css" for css links - $remove_empty_attributes
—
Innoweb\MinifyHTML\Util\bool
Remove some empty attributes - $remove_http_prefix_from_attributes
—
Innoweb\MinifyHTML\Util\bool
Remove optional "http:"-prefix from attributes (disabled by default) - $remove_https_prefix_from_attributes
—
Innoweb\MinifyHTML\Util\bool
remove optional "https:"-prefix from attributes (disabled by default) - $remove_omitted_quotes
—
Innoweb\MinifyHTML\Util\bool
remove quotes e.g. class="lall" => class=lall - $remove_value_from_empty_input
—
Innoweb\MinifyHTML\Util\bool
Remove 'value=""' from empty <input> - $sort_css_class_names
—
Innoweb\MinifyHTML\Util\bool
Sort css-class-names, for better gzip results - $sort_html_attributes
—
Innoweb\MinifyHTML\Util\bool
Sort html-attributes, for better gzip results - $sum_up_whitespace
—
Innoweb\MinifyHTML\Util\bool
Sum-up extra whitespace from the Dom