Gridview (Not Set)


Is there a way to display an alternative if the table cell is empty other than the red (not set) which is currently being displayed?


I fall to this situation too, It been a long time, you may not need this anymore, hopefully, it’s useful to other people.

You can use the nullDisplay property of yii\i18n\Formatter to display what you want.

<?= GridView::widget([

'dataProvider' =&gt; &#036;dataProvider,


	'class' =&gt; 'yii&#092;i18n&#092;Formatter',

	'nullDisplay'=&gt;'This is empty'


'columns' =&gt; [

	['class' =&gt; 'yii&#092;grid&#092;SerialColumn'],