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)
));
Afficher le fichier
Open project: mrclay/minify
Class Usage Examples
Свойство | 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 |
Méthode | Description | |
---|---|---|
__construct ( array $sources ) : null | Create a build object | |
uri ( string $uri, boolean $forceAmpersand = false ) : string | Get a time-stamped URI |
public __construct ( array $sources ) : null | ||
$sources | array | array of Minify_Source objects and/or file paths |
Résultat | null |
echo $b->uri('/site.js');
outputs "/site.js?1678242"
echo $b->uri('/scriptaculous.js?load=effects');
outputs "/scriptaculous.js?load=effects&1678242"
public static string $ampersand | ||
Résultat | string |
public int $lastModified | ||
Résultat | integer |