[eluser]sniperscope[/eluser]
Hello
I am very new about Codeigniterand learning it about 2 hours by now but i am developing web sites using php about 9 years.
I wan to know that how can i display img in codeigniter.
my code and my folder hierarchy is below
top/index.php
news/ all images in here about news
So i call it like;
Code:
if(isset($news))
{
foreach($news as $news)
{
if($news['news_pic'] != "")
{
$img_property = array(
'src' => 'news/' .$news['news_pic'],
'alt' => $news['news_title'],
'width' => '240',
'height' => '320'
);
$news_pic = img($img_property);
}
else
$news_pic = '';
echo '
<li><table class="ibox">
<tr><td class="photo">' .$news_pic. '</td>
<td class="iText"><h3 class="title">' .$news['news_title']. '</h3>
<p class="time">' .date("Y-n-d", $news['news_date']). '</p>' .nl2br($news['news_body']). '</td>
</tr>
</table>';
}
}
so, what i want is to display img tag as follow
<img src="../news/img_name.jpg" alt="some_alt" height="320" width="240" />
Seems i stuck here.
Appreciate for any help.