yiisoft/yii — pull request #1658 by resurtm (2012-11-04 11:40:15+00:00)
Title: Make CFormatter::formatHtml() more customizable.

Use case:

```php
widget('zii.widgets.grid.CGridView',array(
'dataProvider'=>new CArrayDataProvider(array(
array('id'=>1,'title'=>'Google Logo','image'=>'https://www.google.com/images/srpr/logo3w.png'),
array('id'=>2,'title'=>'Chrome Logo','image'=>'https://www.google.com/images/icons/product/chrome-128.png'),
array('id'=>3,'title'=>'Android Logo','image'=>'http://www.android.com/images/logo.png'),
)),
'columns'=>array(
'id',
'title',
array(
'name'=>'image',
'type'=>'html', // 'raw' type is unsafe, don't want to use it
// i know that target="_blank" attribute is not web standards compliant, but nevertheless it's very handy
// and who knows what use case related to the 'html' type may appear in future?
'value'=>'CHtml::link(CHtml::image($data["image"],$data["title"]),$data["image"],array("target"=>"_blank"))',
),
),
)); ?>
```

```php
// i realize that i can extend CFormatter but is it really necessary if there's better way
// to make HTML Purifier instance more configurable and flexible
'format'=>array(
'htmlPurifierOptions'=>array(
'Attr.AllowedFrameTargets'=>array('_blank'),
),
),
```