Email Is Not Hyperlinked In The Grid

I have the below code in the CGridView


 array(

                        'name'=>'emailProfessional',

                        'header'=>'Email 1(Pro)',                                               

                        'value'=>'CHtml::link(CHtml::encode($data->emailProfessional), "mailto:".$data->emailProfessional)',

The output shows as below,


<a href="mailto:rani@gmail.com">rani@gmail.com</a>

instead of hyperlinked with mailto:

I … don’t quite get how that’s wrong? :huh: Also: There’s an [font=“Courier New”]email[/font] type for CGridView and CDetailView. Spares you from assembling the link yourself.

In answer to your specific issue, you need to set the type attribute to either raw or html:




array(

    'name'=>'emailProfessional',

    'header'=>'Email 1(Pro)',

    'type'=>'raw',

    ...

),  



You should follow Da:Sourcerer’s suggestion though.

Ah, so that’s been the displayed (encoded) output and not the raw code ::)

@ Keith, thanks , you’re correct. it worked fine.