Cgridview Incorrectly Uses Blankdisplay And/or Nulldisplay

I want to discuss this issue here (to make myself sure, that this is a bug), before rising a ticket on Github.

Either I’m missing something or both CGridView->nullDisplay and [size=“2”]CGridView->[/size]blankDisplay are working incorrectly in current implementation of Yii.

As I understand this functionality, both should be used, when cell is really empty, which means, that there is nothing in it. Right now, it ignores (purges?) HTML entities and is used even, when there are no text, but there is some HTML.

For example, I have such column definition:





    'htmlOptions'=>array('style'=>'width: 30px')


[size=“2”]Function used here generates image representation of a state. But since I’m using Font Awesome, this is not a true image (for which I could use any kind of image column), but rather a CSS class that uses special font and styling.[/size]

In other words. above mentioned column definition produces for example such code:

<td style="width: 30px">

	<span rel="tooltip" data-delay="500" title="news">

		<i class="icon-comments-alt"></i>



[size=“2”]It’s clearly not empty, but it does not contain any text. Since that, in current implementation Yii adds [/size]$nbsp;[size=“2”] between closing [/size]</span> and </td>. [size=“2”]And I have to either override / change it or use some empty string addition to my [/size]value[size=“2”] attribute, like that:[/size]


[size="2"]For me this is wrong. An [/size]empty[size="2"] cell means an empty cell. A cell [/size]containing[size="2"] HTML code is not ant empty cell and therefore, Yii should not add anything in this case.[/size]

[size="2"]Do you agree with me? Is this a bug / issue? Or am I getting these things wrong?[/size]

GitHub issue -