10-18-2012, 01:19 AM
[eluser]boltsabre[/eluser]
To save a little time coding, I created a few site wide variables, ($IMG_PATH, $CSS_PATH, and $JS_PATH), in my MY_Controller (but you could do it in your config file or whatever suits you best).
Then you can just do this:
It has the advantages that if you every change your directory structure (ie, you move your images from "uploads" to a new folder called "public/images") all you have to do is change $IMG_PATH and everything else will still work! With your current set-up, if you ever change your directory structure you will have to go and change EVERY image src="..."
To save a little time coding, I created a few site wide variables, ($IMG_PATH, $CSS_PATH, and $JS_PATH), in my MY_Controller (but you could do it in your config file or whatever suits you best).
Then you can just do this:
Code:
<img src="<?php echo $IMG_PATH.$image_thumb); ?>" />
It has the advantages that if you every change your directory structure (ie, you move your images from "uploads" to a new folder called "public/images") all you have to do is change $IMG_PATH and everything else will still work! With your current set-up, if you ever change your directory structure you will have to go and change EVERY image src="..."