problem with use CHtml::openTag in the CDetailView

I use CHtml::openTag and CHtml::closeTag in the CDetailView,i want get like


<span style="backgroud:#EEEEEE;">#EEEEEE</span>

and i also set encode is flase,but it’s alsways show


&lt;span style="backgroud:#FFFF99"&gt;#FFFF99&lt;/span&gt;

How can i get no encode html,Thanks!




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

	'data'=>$model,

	'attributes'=>array(

		'id',

		array(

            'name'=>'survey_id',

            'value'=>Survey::getSurvey($model->survey_id)->subject,

        ),

		'name',

		'name_en',

        array(

        	'name'=>'color',

        	'value'=>CHtml::openTag('span',array('encode'=>false,'style'=>'backgroud:'.$model->color)).$model->color.CHtml::closeTag('span'),

        )

	),

)); ?>



anybody can help me?

Please!

You need to set ‘type’=>‘raw’ (in parallel to ‘name’ and ‘value’)

cool!it’s work.




array(

'name'=>'color',

'value'=>CHtml::openTag('span',array('style'=>'backgroud:'.$model->color)).$model->color.CH

'type'=>'raw',

)



but the result is




<span style="">#EFEFEF</span>



the style is empty.

Not related to your problem, but the answer to your next question: ;)


array('style'=>'backgroud:'.$model->color)

It should be background.

Thank you!