我有这样的代码
<a href="<?php base_url() ?>product/detail/<?php echo $i->product_name_seo ?>">
<img src="<?php echo base_url()."upload_image/product/".$i->image ?>" alt="product image" width="72" height="72">
</a>
如何在URL帮助程序锚中重写此代码..?
答案 0 :(得分:1)
试试这个
$this->load->helper(array('url','html'));
$image_properties = array(
'src' => 'upload_image/product/' . $i->image,
'alt' => 'product image',
'width' => '72',
'height' => '72'
);
$img = img($image_properties);
echo anchor('product/detail'.$i->product_name_seo, $img);
答案 1 :(得分:0)
$image = '<img src="<?php echo base_url('upload_image/product/'.$i->image)?>" alt="product image" width="72" height="72">'
<?php echo anchor('product/detail/'.$i->product_name_seo, $image);?>
答案 2 :(得分:0)
<a href="<?php base_url(); ?>product/detail/<?php echo $i->product_name_seo; ?>">
<img src="<?php echo base_url(); ?>upload_image/product/<?php echo $i->image; ?>" alt="product image" width="72" height="72"></a>