Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple assets library. Ability to combine, minify and use the Less syntax.
PHP
branch: master

This branch is 2 commits ahead, 59 commits behind bstrahija:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
config
helpers
libraries
README.markdown
spark.info

README.markdown

Simple Assets Library

A simple assets library that has the ability to combine and minify your JavaScript and CSS assets. Additionally there's a LessPHP compiler, based on the original Ruby implementation.

Third Party Libraries

The libraries JSMin, CSSMin and LessPHP are all created by third parties, but they're included in this package for convinience.

Requirements

  1. PHP 5.1+
  2. CodeIgniter 2.0
  3. Directory structure for the assets files, with a writeable cache directory

Documentation

Set all your preferences in the config file (assets directories, options to minify, combine and parse with LessPHP). Now you can use the helper methods in your views like this:

<?php display_css(array('init.css', 'style.css')); ?>
<?php display_js(array('libs/modernizr-1.6.js', 'libs/jquery-1.4.4.js', 'plugins.js', 'script.js')); ?>

There's also a method for clearing all cached files:

$this->assets->clear_cache();

The default configuration assumes your assets directory is in the root of your project. Be sure to set the permissions for the cache directory so it can be writeable.

Directory structure example

/application
/assets
    /cache
    /css
    /images
    /js
/sparks
/system
Something went wrong with that request. Please try again.