How to user if condition in yii2 gridview active button or deactive botton show on gridview
<p>How  to user if condition in yii2 gridview  active button or deactive button show on gridview</p>

<pre><code>     &lt;div class="report-index"&gt;
    &lt;?= GridView::widget([
    'dataProvider' =&gt; $dataProvider,
    'layout' =&gt; "{summary}\n{items}",
     'columns' =&gt; [
    ['class' =&gt; 'yii\grid\SerialColumn'],
       'username',
        'email',
        'status',
     [
    'attribute'=&gt;'created_at',
    'format' =&gt; ['date', 'php:d.m.Y'],
    ],
    'active',
      [
      'class' =&gt; 'yii\grid\ActionColumn',
      'header' =&gt; 'Action',
      'template' =&gt; '{view}{delete}',
      'buttons' =&gt; [
        'view' =&gt; function ($url, $model,$key) {

            return Html::a('&lt;span class="glyphicon glyphicon-eye-open"&gt;           &lt;/span&gt;', $url, [
                        'title' =&gt; Yii::t('app', 'View'),
            ]);
        },

         'delete' =&gt; function ($url, $model,$key) {

            return Html::a('&lt;span class="glyphicon glyphicon-trash"&gt;&lt;/span&gt;', $url, [
                        'title' =&gt; Yii::t('app', 'Delete'),
            ]);
        },

      ],

     ],

    ],

]); ?&gt;

    &lt;div id="custom-pagination"&gt;
    &lt;?php

      echo LinkPager::widget([
'pagination' =&gt; $pages,
     );

    ?&gt;
</code></pre>

<p>How  to user if condition in yii2 gridview  active button or deactive button show on gridview i use two button when active is 1 show green button if active record 0 show red button </p>

<p>how  to user if condition in yii2 gridview  active button or deactive button show on gridview i use two button when active is 1 show green button if active record 0 show red button </p>