/** * Minify Javascript. * * @param string $js Javascript to be minified * @return string */ public static function minify($js) { $jsmin = new ExposeJSMin($js); return $jsmin->min(); }
protected static function minify($content, $type) { if ($type == 'css') { expose_import('libs.csscompressor'); $content = ExposeCssCompressor::process($content); return $content; } if ($type == 'js') { expose_import('libs.jsmin'); $content = ExposeJSMin::minify($content); return $content; } }