-
Notifications
You must be signed in to change notification settings - Fork 26
Asset Linker
Category:Libraries [b]STILL UNDER DEVELOPMENT, TESTING FINAL SOLUTION & CACHE OPTIONS[/b] [b]Wiki entry still being created[/b]
Asset Linker is a library specifically to help with storage of css/js files and the loading of them.
I don't know about you but when I am writing my websites I find I suddenly need a new css file for just this method of a controller. Now having to add it into the view file manually is just a pain and would mean a new view file for just this method. Also I have a selection of js/css files I need all the time.
So I created this library to try and ease the process. The library can perform the following functions.
- Load a set of default assets including ones specifically for the public/admin & shared assets
- Load an asset on the fly for a particular controller/method
- Unload an asset for a particular controller/method
- Compress all public/admin/shared assets into a single file to save the browser loading many different files
[b]Load asset on the fly[/b] To load an asset on the fly takes just one line of code. [code]$this->assets->load($level,$type,$name);[/code]
[b]Unload asset on the fly[/b] Again a single line [code]$this->assets->unload($level,$type,$name);[/code]
[b]Output assets[/b] In the view file between the html HEAD tags include this line. [code]$this->assets->link($level);[/code]
[b]As said above I have to finish the code off first and then some testing. Sadly I am very busy at the moment with work so I cannot promise a date when it will be done.[/b]