|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* HtmlCompressor.php |
|
4
|
|
|
* @author Revin Roman |
|
5
|
|
|
* @link https://rmrevin.ru |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace rmrevin\yii\minify; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Class HtmlCompressor |
|
12
|
|
|
* @package rmrevin\yii\minify |
|
13
|
|
|
* @deprecated |
|
14
|
|
|
*/ |
|
15
|
|
|
class HtmlCompressor |
|
16
|
|
|
{ |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* "Minify" an HTML page |
|
20
|
|
|
* |
|
21
|
|
|
* @param string $html |
|
22
|
|
|
* @param array $options |
|
23
|
|
|
* |
|
24
|
|
|
* 'cssMinifier' : (optional) callback function to process content of STYLE |
|
25
|
|
|
* elements. |
|
26
|
|
|
* |
|
27
|
|
|
* 'jsMinifier' : (optional) callback function to process content of SCRIPT |
|
28
|
|
|
* elements. Note: the type attribute is ignored. |
|
29
|
|
|
* |
|
30
|
|
|
* 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If |
|
31
|
|
|
* unset, minify will sniff for an XHTML doctype. |
|
32
|
|
|
* |
|
33
|
|
|
* @return string |
|
34
|
|
|
*/ |
|
35
|
1 |
|
public static function compress($html, array $options = []) |
|
36
|
|
|
{ |
|
37
|
1 |
|
return \Minify_HTML::minify($html, $options); |
|
38
|
|
|
} |
|
39
|
|
|
} |
|
40
|
|
|
|