rmrevin / yii2-minify-view

Yii2 View component with minification css & js
MIT License
191 stars 67 forks source link

minify html #55

Closed hooman-mirghasemi closed 6 years ago

hooman-mirghasemi commented 7 years ago

hi html minify have a problem . when i try it with this html:

<?php use hoomanMirghasemi\jdf\Jdf; use kartik\select2\Select2; use yii\helpers\ArrayHelper; use yii\helpers\Html; use common\models\BaseUser; use common\models\Country; use common\models\State; use common\models\CashReport; use common\models\LoginForm; use common\models\SearchInfo; use common\widgets\Alert; use yii\web\View; use frontend\assets\AppAsset; use yii\bootstrap\ActiveForm;

$this->registerJsFile("/js/jquery.autosize.js"); $this->registerJsFile(PROTOCOL.DOMAIN."/bootstrap/js/bootstrap.rtl.js", ['position'=>View::POS_END]); if (Yii::$app->params['analytics']) { $this->registerJsFile("/js/google-analytics.js", ['position'=>View::POS_END]); }

$this->registerJsFile("/js/menu_xs/modernizr.custom.25376.js", ['position'=>View::POS_END]); $this->registerJsFile("/js/menu_xs/classie.js", ['position'=>View::POS_END]); $this->registerJsFile("/js/menu_xs/menu.js",['position'=>View::POS_END]); $this->registerJsFile("/js/main.js",['position'=>View::POS_END]);

$this->registerCssFile(PROTOCOL.DOMAIN."/fonts/fontawesome/font-awesome.css"); $this->registerCssFile("/css/main-ask.css"); $this->registerCssFile("/css/login-page.css"); $this->registerCssFile("/css/other-page-header.css"); $this->registerCssFile("/css/footer.css"); $this->registerCssFile("/bootstrap/css/bootstrap.rtl.min.css");

$this->registerCssFile( "/css/cropiframe.css"); $this->registerCssFile("/css/iframe.css"); $this->registerCssFile("/css/menu_xs/normalize.css"); $this->registerCssFile( "/css/menu_xs/demo.css"); $this->registerCssFile("/css/menu_xs/component.css"); $this->registerCssFile("/css/layouts/body-footer2.css"); $this->registerCssFile("/css/layouts/body-footer1.css"); $this->registerCssFile("/css/layouts/main.css");

AppAsset::register($this);

?> <!DOCTYPE html>

<?= Html::encode($this->title) ?> params['searchEngineIndex']): ?> params['alexa']): ?> head() ?> endBody() ?>

<?php $this->endPage() ?>

this work

and with this html:

<?php use hoomanMirghasemi\jdf\Jdf; use kartik\select2\Select2; use yii\helpers\ArrayHelper; use yii\helpers\Html; use common\models\BaseUser; use common\models\Country; use common\models\State; use common\models\CashReport; use common\models\LoginForm; use common\models\SearchInfo; use common\widgets\Alert; use yii\web\View; use frontend\assets\AppAsset; use yii\bootstrap\ActiveForm;

$this->registerJsFile("/js/jquery.autosize.js"); $this->registerJsFile(PROTOCOL.DOMAIN."/bootstrap/js/bootstrap.rtl.js", ['position'=>View::POS_END]); if (Yii::$app->params['analytics']) { $this->registerJsFile("/js/google-analytics.js", ['position'=>View::POS_END]); }

$this->registerJsFile("/js/menu_xs/modernizr.custom.25376.js", ['position'=>View::POS_END]); $this->registerJsFile("/js/menu_xs/classie.js", ['position'=>View::POS_END]); $this->registerJsFile("/js/menu_xs/menu.js",['position'=>View::POS_END]); $this->registerJsFile("/js/main.js",['position'=>View::POS_END]);

$this->registerCssFile(PROTOCOL.DOMAIN."/fonts/fontawesome/font-awesome.css"); $this->registerCssFile("/css/main-ask.css"); $this->registerCssFile("/css/login-page.css"); $this->registerCssFile("/css/other-page-header.css"); $this->registerCssFile("/css/footer.css"); $this->registerCssFile("/bootstrap/css/bootstrap.rtl.min.css");

$this->registerCssFile( "/css/cropiframe.css"); $this->registerCssFile("/css/iframe.css"); $this->registerCssFile("/css/menu_xs/normalize.css"); $this->registerCssFile( "/css/menu_xs/demo.css"); $this->registerCssFile("/css/menu_xs/component.css"); $this->registerCssFile("/css/layouts/body-footer2.css"); $this->registerCssFile("/css/layouts/body-footer1.css"); $this->registerCssFile("/css/layouts/main.css");

AppAsset::register($this);

?> <!DOCTYPE html>

<?= Html::encode($this->title) ?> params['searchEngineIndex']): ?> params['alexa']): ?> head() ?> endBody() ?>

<?php $this->endPage() ?>

it is not working!!

see diffrent of that tow code only addtional li

hooman-mirghasemi commented 7 years ago

so i try to find out what is the problem but not clear thing was that! for example once more than 15 character in img title was reason of not working html comperosor!!

rmrevin commented 7 years ago

Format the code normally and specify the location of the change. Such code can not be read. Try to replace the Arabic words with English ones and check the minification, maybe a problem with the encoding.

rmrevin commented 6 years ago

Try to use version 2.0. There is an updated engine minification of html. Maybe this will solve Your problem.