2
我可以在詳細信息視圖中顯示圖像,閱讀cannot display image in Yii主題。我想將width和alt標籤添加到img標籤中。可能嗎?如何在CDetailView中添加寬度標籤以在Yii中顯示圖像
我寫如下:
$this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'htmlOptions'=>array('class'=>'table table-striped responsive-table'),
'attributes'=>array(
'id',
'code',
'name',
'description',
array(
'type'=>'raw',
'width'=>'200',
'alt'=>'hi images',
'value'=> CHtml::image(Yii::app()->request->baseUrl.'/images/products/'.$model->image),
),
'price',
),
));
做你試試? – tinybyte
謝謝。有用。 – StreetCoder