GithubHelp home page GithubHelp logo

sergeevizh / smarty-combine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dead23angel/smarty-combine

0.0 2.0 0.0 31 KB

Combine and minify many JS or CSS to one file

License: MIT License

PHP 100.00%

smarty-combine's Introduction

Smarty Combine

Combine plugin allows concatenating several js or css files into one. It can be useful for big projects with a lot of several small CSS and JS files.

Usage examples

Template inline example Smarty 3

{combine input=array('/bm.js','/bm2.js') output='/cache/big.js' use_true_path=false age='30' debug=false}

Smarty 2 example

PHP code

$js_filelist = array('/js/core.js','/js/slideviewer.js');

$smarty_object->assign('js_files', $js_filelist);

Template code

{combine input=$js_files output='/cache/big.js' use_true_path=false age='30' debug=false}

The plugin has 4 parameters:

  • input - must be an array, containing list with absolute pathes to files. In Smarty 3 it can be inline array, for Smarty 2 you will need to pass from yours controller a variable, which will contains this array.
  • output - absolute path to output file. Directory must be writable to www daemon (Usually chmod 777 resolve this problem :)
  • use_true_path - value is a boolean. If it is set to true the plugin will use the paths of the asset files as they are but if set to false it will assume the files have relative paths. By default it is set to false. You can omit this parameter.
  • age - value of seconds between checks when original files were changed. By default it is 3600 - one hour. You can omit this parameter.
  • debug - parameter in the value of TRUE, disable compilation useful for debugging when developing a site.. By default it is FALSE. You can omit this parameter.

smarty-combine's People

Contributors

zoonman avatar dead23angel avatar mazzucode avatar

Watchers

James Cloos avatar Kirill Trubetskoy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.