Download Minifier ! See the Plugin page
Why should I use Minifier ?
There are many reasons for that :
- You don't need to compress your files before uploading them to your server.
- You can have as many CSS files as you want, there will always be only one HTTP request.
- You gain bandwidth.
- Compressed CSS files are cached, so this doesn't use much resources.
How do I use Minifier ?
Minifier is a plugin for the PHP framework Atomik Framework. You need it to use Minifier.
After installing Minifier in your Atomik Framework, you have to do three things :
- Create the assets/css_cache/ folder with read/write access for everyone. This folder's name can be changed by using the 'cache/dir' configuration key.
- Configure Atomik's bootstrap so it uses Minifier :
Atomik::set(array ( 'plugins' => array( 'Minifier', ), );
- Replace the following in your layout file :
<?php foreach (A('styles', array()) as $style): ?> <link rel="stylesheet" type="text/css" href="<?php echo Atomik::asset($style) ?>" /> <?php endforeach; ?>
by<link rel="stylesheet" type="text/css" href="<?php echo Atomik::asset(MinifierPlugin::minify()); ?>" />
or :<?php MinifierPlugin::minify(true); ?>
or if you put the configuration key 'force_css_link' to true :<?php MinifierPlugin::minify(); ?>
After you did it, Minifier is going to do all the job alone. You just have to declare your CSS files as you do it usually with Atomik Framework.