visonforcoding/cakeminify

There is no license information available for the latest version (0.1.3) of this package.

Cakeminify plugin for CakePHP

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

Maintainers

Package info

github.com/visonforcoding/cakephp-minify

Type:cakephp-plugin

pkg:composer/visonforcoding/cakeminify

Statistics

Installs: 1 502

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

0.1.3 2017-03-04 06:14 UTC

This package is not auto-updated.

Last update: 2026-02-15 03:30:17 UTC


README

combine and compress your web asset resource in cakephp3+

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require visonforcoding/cakeminify

##Config

config your asset resource,create a config file named minify.php in config directory。

return[
    'minjs'=>[
       'source'=>[
           '/asset/jquery/dist/jquery.js',
           '/asset/zui/dist/js/zui.js',
           '/asset/vue/dist/vue.js'
       ],
       'desc'=>'/dist/main.js'
    ],
    'mincss'=>[
       'source'=>[
           '/asset/zui/dist/css/zui.css',
           '/css/view.css',
       ],
       'desc'=>'/dist/default.css'
    ],
    
];

##shell combine and compress

bin/cake minify start

the combine file will create in your 'desc' config

##helper

call the helper function in your template

  <?= $this->minify->generateAsset() ?>

##output

output is relation to the debug level

Production Mode:

<link rel="stylesheet" href="/dist/default.css"/>
<script src="/dist/main.js"></script>

Development Mode:

<link rel="stylesheet" href="/asset/zui/dist/css/zui.css"/>
<link rel="stylesheet" href="/css/view.css"/>
<script src="/asset/jquery/dist/jquery.js"></script>
<script src="/asset/zui/dist/js/zui.js"></script>
<script src="/asset/vue/dist/vue.js"></script>