How To Print Special Charactor In <Pre> Tag By Cdetailview

i want to display the math equation using mathjax and generate a latex code of the equation below.


$this->widget('zii.widgets.CDetailView', array(









                    'label'=>'$\TeX$ code',





)); ?>


class Equation extends CActiveRecord






	public function actionView($id)

	{       $equation=$this->loadModel($id);






equation table

id    equation

1     $x^2=2$

2     $360^\circ=2\pi$

3     $1\text{rad}=57^\circ 17' 45''$

the equation outputs works fine with mathjax but the apostrophe in tex code becomes &#039.

it is expected to show $1\text{rad}=57^\circ 17’ 45’’$

but it appears to be

$1\text{rad}=57^\circ 17&#039 45&#039&#039$

the same question appears here.

You’re using CHtml::encode($model->equation), that’s how it works.

Maybe you should remove it like you did for first column?..

thank you for your advice, when removed the CHtml::encode it shows nothing…