2014-08-28 41 views
0

我使用zii.widgets.CDetailView的Yii上CDetailView添加鏈接無法正常工作

當我嘗試添加與目標=鏈接「_空白」。 儘管我添加了目標空白,但這種方式無法正常工作。 鏈接總是在相同的標籤

這裏開我的代碼:

$this->widget('zii.widgets.CDetailView', array(
'data'=>$model, 
'htmlOptions'=>array('class'=>'table table-condensed table-hover'), 
'attributes'=>array(
    'idproduct', 
    array(
     'name'=>'Preview', 
     'type'=>'html', 
     'value'=>(
      (!empty($model->picture->filename_thumb))? 
      CHtml::image(Yii::app()->baseUrl . "/images/product/".$model->picture->filename_thumb,"Preview",array("width"=>"75px","height"=>"75px")):"No Image"    
     ), 
    ), 
    array(
     'name'=>'Company', 
     'type'=>'html', 
     'value'=>$model->company->name, 
    ), 

    array(
     'name'=>'Product URL', 
     'type'=>'html', 
     'value'=>CHtml::link(CHtml::encode('Click Here'), "http://localhost/voucher/".$model->urlproduct, array("class"=>"btn btn-info","target"=>"_blank")) 
    ), 
), 

));

回答

1
array(
    'name'=>'Product URL', 
    'type'=>'html', 
    'value'=>CHtml::link(CHtml::encode('Click Here'), "http://localhost/voucher/".$model->urlproduct, array("class"=>"btn btn-info","target"=>"_blank")) 
), 

變化的 '類型'=> 'HTML',

爲 '類型'=> '原始',