myzend/minify

Zend Framework 2 module which uses the Steve (mrclay) Clay's Minify library for styles and scripts minification.

This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.

Installs: 521

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 4

Open Issues: 4

pkg:composer/myzend/minify

0.9.2 2013-07-19 19:20 UTC

This package is not auto-updated.

Last update: 2025-09-09 08:14:38 UTC


README

Usage

The view helper minifyFiles will create a uniquer minify file, which only will be generated again if you delete it.

Single file

$this->headScript()->appendFile($this->minify($this->basePath() . '/js/login/bootstrap.js'));
$this->headScript()->appendFile($this->minify($this->basePath() . '/js/login/jquery.validate.js'));

Group files, you can control files order

$this->headLink()->appendStylesheet(
							$this->minify(
								array(
									$this->basePath() . '/css/bootstrap/bootstrap.css',
									$this->basePath() . '/css/bootstrap/bootstrap-responsive.css',
									$this->basePath() . '/css/animate.css',
									$this->basePath() . '/css/main.css'
								)
							)
						);

Wildcard way

$this->headLink()->appendStylesheet($this->minify($this->basePath() . '/css/login/bootstrap/*.css'));

Other options

$this->headLink()->appendStylesheet(
							$this->minify(
								array(
									$this->basePath() . '/css/bootstrap/*.css',
									$this->basePath() . '/css/animate.css',
									$this->basePath() . '/css/main.css'
								)
							)
						);
Delete all files when deploy new changes.
find . -name "min-*" -exec rm -rf {} \;
Ignore minified files on your repository (.gitignore)
min-*