I want output attribute description
as HTML code in CDetailView.
<?php $this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
'title',
'description' => array(
'name' => 'description',
'value' => html_entity_decode(CHtml::decode($model->description)),
),
'price',
'date',
),
));?>
You will want to use the
:html
format:For other formats, see CFormatter.
You can even extend CFormatter, and create your own formats.
If you extend the CFormatter, update your project's main.php to point to the new file:
Example Usage: