-
Notifications
You must be signed in to change notification settings - Fork 26
Asset Helper
The Asset Helper is designed to make keeping track of those pesky JavaScript, image, CSS and flash files just that little bit easier. We all know that its a bad plan to keep your files in your system/ folder, so where else can they go?
By using Asset Helper they can be easily stored on the site in a seperate folder and will also give you a firm structure to keep your files all organised logically.
[b]Folder Structure[/b]
[quote]assets/ -- css/ -- image/ -- js/ -- modules/ ---- modulename/ ------ css/ ------ image/ ------ js/ ---- modulename2/ ------ css/ ------ image/ ------ js/ [/quote]
This folder structure should make sense to you. Basically you have your generic files (logos, general stylesheets, banners, buttons, etc) and you have page specific ones, such as sub-page backgrounds and section headers. These go in a module in the asset folder named whatever you want (makes sense to give it the same name as your controller though eh?).
[b]Useage[/b] [code]$this->load->helper('asset');
// Load a css file from the main asset css folder css_asset('filename.css');
/