|
本帖最后由 deber 于 2011-11-25 23:05 编辑
<div id="product_left"> <div id="product_image">
<?php //get the primary photo for the product
$photo = '<img src="'.base_url('images/nopicture.png').'" alt="no picture available"/>';
if(count($product->images) > 0 )
{ $primary = $product->images[0];
foreach($product->images as $image)
{ if(isset($image->primary))
{
$primary = $image; }
}
$photo = '<a href="'.base_url('uploads/images/medium/'.$primary->filename).'" rel="gallery" title="'.$primary->caption.'"><img src="'.base_url('uploads/images/small/'.$primary->filename).'" alt="'.$product->slug.'"/></a>'; }
echo $photo;
if(!empty($primary->caption)):?>
<div id="product_caption">
<?php echo $primary->caption;?>
</div>
<?php endif;?>
</div>
语句如上,请问$image->primary代表什么,$primary->filename有代表什么意思呢,为什么显示不了图片呢。多谢大侠。
|
|