zu3i4ot
(Zu3i4ot)
1
hi i want to know that how can i render the html fetched from the db and not let it convert to html special chars i-e
i have this stored in the db:user <a href="/mysite/index.php?r=profile/view&id=2">test</a> wants to join <a href="">a group</a> plz respond
and when it is shown in the view is is shown as it is, what i want is that the link should be converted in to link
how can i do it?
jacmoe
(Jacob Moena)
2
Set the type to ‘raw’ in the listview widget.
Otherwise Yii will run htmlentities on it.
zu3i4ot
(Zu3i4ot)
3
thanks a lot it works
i used it like this
$this->widget('zii.widgets.CDetailView', array(
'data'=>$model,
'attributes'=>array(
'id',
array(
'name'=>'message',
'value'=>html_entity_decode($model->message),
'type'=>'raw',
),
),