defyma / yii2-minifier
Yii 2 Minifier
Installs: 1 334
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:helper
Requires
- yiisoft/yii2: ~2.0.0
README
This minifier using https://github.com/mrclay/minify, and integrated for yii2
Install With Composer
php composer.phar require defyma/yii2-minifier:"v1.*.*"
Or Require it
"defyma/yii2-minifier": "v1.*.*"
How To Use
- Add
<?php \defyma\helper\Minifier::begin(); ?>
and<?php \defyma\helper\Minifier::end(); ?>
in Layout or View
Example
layout/main.php
<!-- Minifier Begin -->
<?php \defyma\helper\Minifier::begin(); ?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
<!--
// Content Head
-->
</head>
<body>
<?php $this->beginBody() ?>
<!--
// Content Body
-->
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
<?php \defyma\helper\Minifier::end(); ?>
<!-- Minifier END -->
Library used
- Original Spaceless Yii2
- HTML & CSS Minifier Using Minify By Stephen Clay steve@mrclay.org
- JavaScript Minify Using JShrink By Elan Ruusamäe glen@pld-linux.org
To Use Custom Library please refer to @vendor\defyma\yii2-minifier\Minifier.php.