CodeIgniter Forums

Full Version: Simple assets library
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

El Forum

[eluser]Boris Strahija[/eluser]
I was using the carabiner library, but I wanted something simpler so I created my own. It's base on the excellent carabiner library so there are some similarities, but I wanted to keep it as simple as possible.

All you need to do is load the library, and add the following code to your HTML:
Code:
<?php
    display_css(array('init.css', 'style.css'));
    display_js(array('libs/modernizr-1.6.js', 'libs/jquery-1.4.4.js', 'plugins.js', 'script.js'));
?>

CSS and JS files are combined, minified and stored to the cache folder under assets. You can turn of minifying in the config, but not combining for now.
Oh, and LessPHP is supported and included. There are some examples in the css file, so go and play with it.

The libraries included CSSMin, JSMin and LessPHP are not mine, just to clarify.

---

And another update, version 0.6.0 is up!
Code:
php tools/spark install -v0.6.0 assets

Or:
https://bitbucket.org/bstrahija/assets

And now also available on Github:
https://github.com/bstrahija/assets

El Forum

[eluser]mr.noname[/eluser]
Hi Boris Strahija and thank for your library

I'm Thai, sorry for my English.


Quote:The libraries included CSSMin, JSMin and LessPHP

I try do download your library but could not find some libraries.


1. require APPPATH."libraries/lessc.php

2. $this->ci->load->library(array('cssmin', 'jsmin'));


or what's wrong with me?

El Forum

[eluser]mr.noname[/eluser]
sorry man
i get it from carabiner library

but still look for lessc library.

El Forum

[eluser]Boris Strahija[/eluser]
Yep, my bad. The files are there now, just download the whole thing again.

El Forum

[eluser]Boris Strahija[/eluser]
There is an update, allowing to switch off combining the files, so check it out. I would love some feedback.

Oh and it's tested and working great with CI Reactor Wink

El Forum

[eluser]Roobiz[/eluser]
Very very awesome lib !!!

There is just a little issue with "dev" environnement.

See my bug report here : https://bitbucket.org/bstrahija/assets/i...oesnt-work

El Forum

[eluser]Boris Strahija[/eluser]
I'm working on a update, and will convert the library into a spark in the next couple of days. Stay tuned for updates Wink

El Forum

[eluser]Roobiz[/eluser]
Great! I'll give you feedback when it will be release Smile

El Forum

[eluser]Boris Strahija[/eluser]
I answered your bug report, could you take a look?

El Forum

[eluser]Boris Strahija[/eluser]
New version is up

The library is now available as a spark:
Code:
php tools/spark install -vv0.3 assets

Or get it here:
https://bitbucket.org/bstrahija/assets
Pages: 1 2