<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'rowOptions' => function ($model, $key, $index, $grid)
{
if($model->status == Contract::STATUS_OPEN){
$now = new \DateTime(date('Y-m-d'));
$date = new \DateTime($model->date_stop);
if($date == $now){
return ['class' => 'success'];
}
if($date < $now){
return ['class' => 'danger'];
}
}
},
]);