2016-08-11 35 views
0

我有一個CGridView,一個特定的列是CLinkColumn。本專欄的頁腳目前以純文本形式出現,我也需要將它鏈接到超鏈接。在CGridView,Yii中鏈接頁腳文本1.1.15

$this->widget('zii.widgets.grid.CGridView', array(
     'dataProvider'=>$provider_sales, 
     'columns'=>array(
      ..., 
      array(     
       'header'=>'Status', 
       'class'=>'CLinkColumn', 
       'urlExpression'=>function($data){ return ...}, 
       'footer'=> number_format($totals['status']), 
      ), 
     ), 
)); 

如何將其轉換爲超鏈接? 現在我只需要一個腳註項目來超鏈接,這可能會改變明天。

回答

0

你好你可以簡單地使用這個CHtml::linkfooter

'footer'=> CHtml::link(number_format($totals['status']),Yii::app()->createUrl("Your_Url"),array("target"=>"_blank")), 

您也可以在此

CHtml::link('Link Text',array('controller/action', 
             'param1'=>'value1')); 

通過param欲瞭解更多信息,請閱讀http://www.yiiframework.com/wiki/48/by-example-chtml/#hh0