Mr.SH Mr.SH - 1 year ago 150
PHP Question

Yii CGridView make url in data column

I am new to Yii and trying to make modify one application which use


I am trying to pass 2 divs in one column and also trying to get URL too.

This is my code:

'value' => 'CHtml::tag("div", array("class"=>""),
"<div class=cname>.$data->name."</div>".
"<br><div class=cname1> Status | Copy "."</div>"

In the above I want to put link to Status and Copy

The code which generate URL is this:

'value' => 'CHtml::link($data->id, Yii::app()->createUrl("overview/cam", array("uid" => $data->id)))',

I have tried many options but nothing is working.


Answer Source

You should try 'url' instead of 'value' in CGridView

'url'=>'Yii::app()->createUrl("overview/cam", array("uid" => $data->id))',

If you use value then do something like this..

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download