在 Codeigniter 的 PHP 中包含 HTML 图像标签


including html image tag inside php in codeigniter

<?php foreach($fullmap as $tr)
    {
    $map->addMarkerByAddress($tr->latitude.','.$tr->longitude, " ", '<h3>'.$tr->restaurant_name.'</h3><img width="80" height="80" src="'.base_url().$tr->images.'" class="img-circle" alt="user1" style="width:50px; height:50px;"><p>'.$tr->description.'<a href="'.site_url('main/restros_quick_view').'?restro_id='.$tr->restaurant_id.'" class="three-inner-detail">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">Detail</span></a></p>', "http://demos.thesoftwareguy.in/google-map1/icons/islam.png" );
    } ?>

朋友们您好,上面的代码工作正常,但是正如您在最后一行中看到的那样,我从链接中显示了图标,但是我需要显示自己的图标,那么如何在图像文件夹中 php.my 图标内编写img src标签,图标的名称为test1.jpg,,正在使用代码点火器框架工作

无需放置IMG标签,Google标记只需要图像路径,因此只需提供路径,IMG标签将仅通过地图添加。

<?php foreach($fullmap as $tr)
{
$map->addMarkerByAddress($tr->latitude.','.$tr->longitude, " ", '<h3>'.$tr->restaurant_name.'</h3><img width="80" height="80" src="'.base_url().$tr->images.'" class="img-circle" alt="user1" style="width:50px; height:50px;"><p>'.$tr->description.'<a href="'.site_url('main/restros_quick_view').'?restro_id='.$tr->restaurant_id.'" class="three-inner-detail">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">Detail</span></a></p>', base_url() . "assets/images/icon.png" );
} ?>

你可以写这个base_url() . "assets/images/icon.png"