如何使用&如何在codeigniter中编写url helper的格式


How to using & how the format of writing url helper in codeigniter

我有一个这样的代码

<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 helper锚中重写此代码…?

试试这个

    $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);
 $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);?>
<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>