Dropin plugin for Smarty Templates to compress inline blocks of CSS, javascript or HTML. The compression used for this plugin relies the minifier.org PHP library.
Make sure you have composer running from CLI, and make sure you have PHP in the system path so its executable from CLI aswell. You need composer to download the latest version of the minifier labrary, and you will need PHP to run the build script so you get the compiled phar file.
You will need to download the minifier classes to your project by doing this:
$ composer require matthiasmullie/minify
Then you will have to compile the plugin with the build.php function:
$ php build.php
In the build directory you should now find a file called "block.compressor.phar" which should be renamed to "block.compressor.php". This file can be dropped into your Smarty Templates plugins folder.
<script>
{compressor type="[css|js|html]"}
var somejs = value;
var morejs = value;
{/compressor}
</script>
If type is omitted no compression is done at the moment.
Depending on your setup you could try with a precompiled file, just drop it into your Smarty Tempates plugins folder and you are ready to go.
prebuildt phar file ready for Smarty Plugins folder
MIT