3

I use CButtonColumn look like this:

array('header'=>'Operations',
'class'=>'CButtonColumn',
'template'=>'{view}{update}',
'buttons'=>array
('view' => array
('url'=>'Yii::app()->createUrl("Unit/view", array("id"=>$data->Id))',),

It works fine, but instead of this page I want to display another page

This one

  echo CHtml::link($data->project->Title, 
   'http://www.****.***/en/unit_detail/'.$data->Id, );

How can I insert this Html link in a CButtonColumn

4

2 回答 2

2

使用属性viewButtonUrl、viewButtonLabel

array('header'=>'Operations',
    'class'=>'CButtonColumn',
    'template'=>'{view}{update}',
    'viewButtonUrl'=>'"http://www.****.***/en/unit_detail/".$data->Id'
    ....
于 2014-04-11T04:51:33.443 回答
1

尝试这个

'buttons'=>array
('view' => array
(
'label'=>'$data->project->Title',
'url'=>'urlencode("http://www.****.***/en/unit_detail/$data->Id")',
'imageUrl'=> false),
于 2014-04-11T04:33:00.633 回答