Skip to content

Plugin for Smarty Templates to compress blocks of CSS, Javascript and HTML.

License

Notifications You must be signed in to change notification settings

steinhaug/smarty-templates-block-compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smarty templates block compressor

License

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.

PREREQUISITE

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.

OVERVIEW

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.

SYNTAX

<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.

YOU COULD TRY A PRECOMPILED FILE

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

License

MIT

About

Plugin for Smarty Templates to compress blocks of CSS, Javascript and HTML.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages