Non-Static Method Cformatter::formatemail() Should Not Be Called Statically, Assuming $This From Incompatible Context

How to resolve error:

Non-static method CFormatter::formatEmail() should not be called statically, assuming $this from incompatible context


<b><?php echo CHtml::encode($data->getAttributeLabel('email')); ?>:</b>

<?php echo CFormatter::formatEmail($data->email); ?> 




Yii::app()->formatter->formatEmail($data->email);



I tried your suggestion but I got an CException. What I missed?


Yii::app()->formatter->formatEmail($data->email);

CException

Property "CWebApplication.formatter" is not defined.

sorry, my mistake:

Yii::app()->format

instead of

Yii::app()->formatter

it is standard component for every CApplication descendant so it should work.

Thank so much Sir redguy. :D

It now works.