CgridView external URL

Hello,

I have a CGridview with one column being the email. I would like to link the email to a external url (search email on my gmail account https://mail.google.com/mail/?shva=1#search/ <email address>)

Can I get that? And with a cbuttoncolumn?

The line code not working:


            

array('class'=>'CLinkColumn',

'header'=>'email',

'labelExpression'=>'$data->email',

'url'=>'https://mail.google.com/mail/?shva=1#search/'.$data->email),



I get only "https://mail.google.com/mail/?shva=1#search/" but nothing is attached.

The button code not working




'class'=>'CButtonColumn',

'template'=>'{email}{update}{error}{delete}',

'buttons'=>array

(

  'email' => array(

    'imageUrl'=>Yii::app()->request->baseUrl.'/images/gmail.png',

    'url'=>'https://mail.google.com/mail/?shva=1#search/'.$data->email,

  ),




Got an error inside the cell.

Tried on both with url and urlExpression with no success.

Any help?

CLinkColumn, CButtonColumn, etc. interpret everything inside the ‘’.




// When you do it like this, CLinkColumn only interprets everything inside the '...', so $data is being ignored:   

array('class'=>'CLinkColumn',

   'header'=>'email',

   'labelExpression'=>'$data->email',

    'url'=>'https://mail.google.com/mail/?shva=1#search/'.$data->email),


// Instead, use ' and " with care, and put everything to be interpreted inside the '':

array('class'=>'CLinkColumn',

   'header'=>'email',

   'labelExpression'=>'$data->email',

    'url'=>'"https://mail.google.com/mail/?shva=1#search/" . $data->email'),


// Ditto for CButtonColumn. This should work:

'url'=>'"https://mail.google.com/mail/?shva=1#search/" .$data->email',




Thanks Emily.