Minify_HTML::__construct PHP Method

__construct() public method

Create a minifier object
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 function __construct($html, $options = array())
    {
        $this->_html = str_replace("\r\n", "\n", trim($html));
        if (isset($options['xhtml'])) {
            $this->_isXhtml = (bool) $options['xhtml'];
        }
        if (isset($options['cssMinifier'])) {
            $this->_cssMinifier = $options['cssMinifier'];
        }
        if (isset($options['jsMinifier'])) {
            $this->_jsMinifier = $options['jsMinifier'];
        }
        if (isset($options['jsCleanComments'])) {
            $this->_jsCleanComments = (bool) $options['jsCleanComments'];
        }
    }