Skip to content

dsturm/minify-for-croogo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minify plugin for CakePHP

Copyright 2012, Maury M. Marques Licensed under The MIT License Redistributions of files must retain the above copyright notice.

Minify

Minify is an application that combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers.

More info: http://code.google.com/p/minify

For this plugin, the application Minify is inside Vendor

Version

Written for CakePHP 2.0+

Installation

You can clone the plugin into your project (or if you want you can use as a submodule):

cd path/to/app/Plugin or /plugins
git clone https://github.com/maurymmarques/minify-cakephp.git Minify

Bootstrap the plugin in app/Config/bootstrap.php:

<?php
CakePlugin::load(array('Minify' => array('routes' => true)));

Configuration

Set the configuration file in your app/Config/core.php

<?php
Configure::write('MinifyAsset', true);

If you do not want to use compression, set false.

Create a folder called "minify" in app/tmp/cache and give permission to read and write.

Usage

Enable the helper using the plugin syntax

<?php
class BakeriesController extends AppController {
    public $helpers = array('Minify.Minify');
}

This plugin uses HtmlHelper, and works virtually the same.

In the view you can use something like:

<?php
echo $this->Minify->css(array('default', 'global'));
echo $this->Minify->script(array('jquery', 'interface'));

About

MInify plugin for CakePHP 2.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published