image plugin |
[eluser]steel_slasher[/eluser]
this is my first contribution the the CI development/expansion basically i wanted to load images in HTML without all the slashes and speech marks so i thought i would make a helper at first but realised i would only need one function so i moved to a plug-in. Basically you load the plug-in like so: Code: $this->load->plugin('image'); and to output the image HTML you use this function: Code: $file = "myimage.gif"; a default path can be set in the plugin file itself (this bit needs testing at the min): Code: <?php Code: $path="/system/images/" Code: $path="/whatever/folder/youwant/" if you want to use the default path just call the function with the file variable Code: $file = "myimage.gif"; if you want to load several images then an array can be used Code: $files= array("file1.gif", "file2.gif", "file3.gif"); here is the source: Code: <?php if there are any problems please say and also i am planning to expand to cover other media types like flash but then it would become a helper. Download it here: http://sitecrackerz.wordpress.com/2008/0...-app-ever/ |
Messages In This Thread |
image plugin - by El Forum - 04-10-2008, 11:51 AM
image plugin - by El Forum - 04-10-2008, 12:05 PM
image plugin - by El Forum - 04-11-2008, 03:04 AM
|