how do i have a link to a page and ajax link in gridview yii
-
15-10-2022 - |
Question
When user clicks on the main message, the message is read and is redirected to the messages.
'value'=>function($data,$row){
$id =Yii::app()->user->getId();
if ($data->id) ==Yii::app()->user->getId())
return CHtml::link(substr($data->comments, 0, 70)."...",
Yii::app()-createUrl("controller/comments", array("id"=>$data->message_id)),
array("controller/ajaxRead", "id"=>$data->id),array("class"=>"ajaxRead"));
else...blah
What I have here is the message inbox.. the link goes to the messages, to "controller/comments". So I want to show the link but it's the first message of it. When user clicks, "controller/ajaxRead" is called.
shows the initial message
substr($data->comments, 0, 70)
the link it goes to when the user clicks
Yii::app()-createUrl("controller/comments", array("id"=>$data->message_id))
and the ajax link, when clicked changes to read
array("controller/ajaxRead", "id"=>$data->id),array("class"=>"ajaxRead"));
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow