Hello;
I am brand new to the CI framework and have just received the Professional CodeIgniter textbook. I started following the steps in the book with setup and configuration, etc.
I reached chapter 4 (page 86) where we create the home page view. The code is displaying the images with a statement like:
Code:
echo "<img src='".$mainf['image']."' border='0' align='left'/>\n";
which works for me although I do not see how the src finds the image in the images directory but it does.
When I reached the part about creating the category view (page 96), as well as the product view (page 100), and search view (page 103), it uses the same type of convention to display the images respectively like:
Code:
echo "<img src='".$list['thumbnail']."' border='0' align='left'/>\n";
echo "<img src='".$product['image']."' border='0' align='left'/>\n";
echo "<img src='".$list['thumbnail']."' border='0' align='left'/>\n";
echo "<img src='".$list['thumbnail']."' border='0' align='left'/>\n";
which does not work unless I put the base_url before the image name like:
Code:
echo "<img src='".base_url().$list['thumbnail']."' border='0' align='left'/>\n";
which makes sense to me that you need the path. I tried to look back at all configuration information in chapter 3 but don't see why the previous code statements work without the base_url.
Could someone please clue me in on this? Thanks for any help.