dev-master
9999999-dev https://github.com/maurymmarques/minify-cakephpA CakePHP plugin that facilitates the use of PHP Minify with CakePHP
MIT
The Requires
- composer/installers *
- php >=5.3.0
by Maury M. Marques
plugin cakephp minify
A CakePHP plugin that facilitates the use of PHP Minify with CakePHP
This plugin was developed to facilitate Minify use with CakePHP, (*1)
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., (*2)
More info: http://code.google.com/p/minify, (*3)
For this plugin, the Minify application is inside Vendor, (*4)
Written for CakePHP 2.x, (*5)
Copyright (c) 2011 Maury M. Marques, (*6)
You can install this plugin using Composer, GIT Submodule, GIT Clone or Manually, (*7)
[Using Composer], (*8)
Add the plugin to your project's composer.json
- something like this:, (*9)
{ "require": { "maurymmarques/minify-plugin": "dev-master" }, "extra": { "installer-paths": { "app/Plugin/Minify": ["maurymmarques/minify-plugin"] } } }
Then just run composer install
, (*10)
Because this plugin has the type cakephp-plugin
set in it's own composer.json
, composer knows to install it inside your /Plugin
directory, rather than in the usual vendors file., (*11)
[GIT Submodule], (*12)
In your app directory (app/Plugin
) type:, (*13)
git submodule add git://github.com/maurymmarques/minify-cakephp.git Plugin/Minify git submodule init git submodule update
[GIT Clone], (*14)
In your plugin directory (app/Plugin
or plugins
) type:, (*15)
git clone https://github.com/maurymmarques/minify-cakephp.git Minify
[Manual], (*16)
Minify
app/Plugin/
or plugins
Bootstrap the plugin in app/Config/bootstrap.php:, (*17)
CakePlugin::load(array('Minify' => array('routes' => true)));
Set the configuration file in your app/Config/core.php, (*18)
Configure::write('MinifyAsset', true);
If you do not want to use compression, set false
., (*19)
Create a folder called "minify" in app/tmp/cache
and give it permission to read and write., (*20)
Enable the helper using the plugin syntax, (*21)
class BakeriesController extends AppController { public $helpers = array('Minify.Minify'); }
This plugin uses HtmlHelper, and virtually it works in the same way., (*22)
In the view you can use something like:, (*23)
echo $this->Minify->css(array('default', 'global')); echo $this->Minify->script(array('jquery', 'interface'));
A CakePHP plugin that facilitates the use of PHP Minify with CakePHP
MIT
plugin cakephp minify