コード例 #1
0
 /**
  * "Minify" an HTML page
  *
  * @param string $html
  *
  * @param array $options
  *
  * '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
  */
 public static function optimize($html, $options = array())
 {
     $min = new HTML_Optimize($html, $options);
     try {
         return $min->_optimize();
     } catch (\Exception $e) {
         return $min->css;
     }
 }
コード例 #2
0
ファイル: HTML_Optimize.php プロジェクト: naka211/myloyal
 /**
  * "Minify" an HTML page
  *
  * @param string $html
  *
  * @param array $options
  *
  * '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
  */
 public static function optimize($html, $options = array())
 {
     $min = new HTML_Optimize($html, $options);
     return $min->_optimize();
 }
コード例 #3
0
ファイル: HTML_Optimize.php プロジェクト: educakanchay/educa
 /**
  * "Minify" an HTML page
  *
  * @param string $html
  *
  * @param array $options
  *
  * '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
  */
 public static function minify($html, $options = array())
 {
     $min = new HTML_Optimize($html, $options);
     return $min->process();
 }