Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Minify module for Kohana 3 - Currently in use on Mooniacs
PHP
Branch: master

This branch is 10 commits ahead, 14 commits behind pocesar:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
minify
README.md

README.md

It's a Minify module (has been heavily modified to fit kohana auto-loading style, structure and code wise) based on the best minifier for PHP imho > http://code.google.com/p/minify/ Extract the contents to 'modules' folder, enable it in the bootstrap:

Kohana::modules(array(
  'minify' => MODPATH.'minify', // Minify
));

and the only thing you need to do actually, is to create a subfolder on 'application/cache' called minify, and you're ready to go (otherwise you'll get problems with the file cache). Call it in your HTML files like:

<link href="/min?f=file1.css,file2.css,file3.css&b=/css/" rel="stylesheet">

it's already configured with a route called minify, that maps to '/min', and if you don't want to output what is your js or css folder, you can use groups, by specifying it in your /application/config/minify.php file:

in PHP:

return array(
   'groupsConfig' => array(
       'css' => array('//css/file1.css', '//css/file2.css', '//css/file3.css')
   )
);

in HTML:

<link href="/min?g=css" rel="stylesheet">

Kohana style:

<?php echo html::style('min?g=css') ?>

Have fun!

Something went wrong with that request. Please try again.