title: YII2 insert icon in the gridview
body: <p>In the gridview, there is a date column. There are times that the date is blank. What I want is if the date is blank, it will display and "x" icon in red color and if there is date in it, it will display a check icon in green color. How is that done in the gridview? </p>
  
  <p>Here is the code so far...</p>
  
  <pre><code>&lt;?= GridView::widget([
          'dataProvider' =&gt; $dataProvider,
          'filterModel' =&gt; $searchModel,
          'columns' =&gt; [
              ['class' =&gt; 'yii\grid\SerialColumn'],
              [
                  'attribute'=&gt;'province',
                  'value'=&gt;'incomingSp.brgyCode.cityCode.province.prov_name',
              ],
              [
                  'attribute'=&gt;'city',
                  'value'=&gt;'incomingSp.brgyCode.cityCode.city_name',
              ],
              [
                  'attribute'=&gt;'brgy',
                  'value'=&gt;'incomingSp.brgyCode.brgy_name',
              ],
              [
                  'attribute'=&gt;'title',
                  'value'=&gt;'incomingSp.sp_title',
              ],
  
              'incoming_sp_id',
              'date_encoded',
              'encoded_by',
              ['class' =&gt; 'yii\grid\ActionColumn',
                  'template'    =&gt; '{view}{update}{delete}',
              ],
          ],
      ]); ?&gt;
  </code></pre>