Adam Griffiths' Open Source Libraries


Overview

AG_Asset is an Asset Management Library built for the CodeIgniter PHP framework. AG_Asset allows you to easily manage your site assets (css files, image and javascript files) allowing you to store them in an assets folder and easily giving you the functions to load them at any point in your application. This is extremely useful as not only can it load in files with their appropriate HTML tags (css files are linked in, images are tagged and javascript files are wrapped in script tags) but it also allows you to simply return the path to the specific directory for extra flexibility.

Function reference

Function Passable parameters Description
return_path boolean - TRUE or FALSE When used it will make all load functions return the path to the asset rather than link it in.
load_css name of css file including extension, optional subfolder(s), media type (default is 'screen') Will link in the CSS file using the <link> HTML tag.
load_image name of image, optional subfolder(s), optional array of CSS styles Will link in the image file using the <img> HTML tag.
load_script name of image, optional subfolder(s) Will link in the script file using the <script> HTML tag.