Welcome Guest, Not a member yet? Register   Sign In
Can img tag be used in a view?
#6

is it solved or not, if stil figure out it hope this help some one else who came up with this issue

here is simple

Code:
<?php
//define your path as variable
$image_path = base_url()."image/barang";
if ($row->gambar1=='')
{
//show image without database
echo " <img class='list-group-image' src='$image_path/noimage.png' />";
}
else
{
//show image with database
echo " <img class='zoom_01 group list-group-image' src='$image_path/$row->gambar1' alt=''  data-zoom-image='$image_path/$row->gambar1'/>";
}
?>


remember you cannot show image came from datase like this
<img src="<?php echo base_url()/uploads/artikel/1.png?>">

You should define path, Thanks


Freddy Sidauruk
Reply


Messages In This Thread
Can img tag be used in a view? - by cupboy - 04-16-2015, 02:37 PM
RE: Can img tag be used in a view? - by Rufnex - 04-16-2015, 02:56 PM
RE: Can img tag be used in a view? - by RobertSF - 04-16-2015, 03:03 PM
RE: Can img tag be used in a view? - by freddy - 06-05-2015, 09:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB