PHP Class Minify_Build, minify

in config file $groupSources = array( 'js' => array('file1.js', 'file2.js') ,'css' => array('file1.css', 'file2.css', 'file3.css') ) during HTML generation $jsBuild = new Minify_Build($groupSources['js']); $cssBuild = new Minify_Build($groupSources['css']); $script = ""; $link = ""; in min.php Minify::serve('Groups', array( 'groups' => $groupSources ,'setExpires' => (time() + 86400 * 365) ));
Author: Stephen Clay ([email protected])
Mostra file Open project: mrclay/minify Class Usage Examples

Public Properties

Property Type Description
$ampersand string String to use as ampersand in uri(). Set this to '&' if you are not HTML-escaping URIs.
$lastModified integer Last modification time of all files in the build

Public Methods

Method Description
__construct ( array $sources ) : null Create a build object
uri ( string $uri, boolean $forceAmpersand = false ) : string Get a time-stamped URI

Method Details

__construct() public method

Create a build object
public __construct ( array $sources ) : null
$sources array array of Minify_Source objects and/or file paths
return null

uri() public method

echo $b->uri('/site.js'); outputs "/site.js?1678242" echo $b->uri('/scriptaculous.js?load=effects'); outputs "/scriptaculous.js?load=effects&1678242"
public uri ( string $uri, boolean $forceAmpersand = false ) : string
$uri string
$forceAmpersand boolean (default = false) Force the use of ampersand to append the timestamp to the URI.
return string

Property Details

$ampersand public_oe static_oe property

String to use as ampersand in uri(). Set this to '&' if you are not HTML-escaping URIs.
public static string $ampersand
return string

$lastModified public_oe property

Last modification time of all files in the build
public int $lastModified
return integer