return Yii::$app->formatter->asDateTime($data->{$attr}, Yii::$app->formatter->dateFormat) . ' <small style="color:gray;">' . Yii::$app->formatter->asDateTime($data->{$attr}, Yii::$app->formatter->timeFormat) . '</small>';
                }, 'filter' => false, 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
            case Content::ATTR_TYPE_BOOLEAN:
                $columns[] = ['attribute' => $attr, 'format' => 'raw', 'value' => function ($data) use($attr, $value) {
                    return Html::checkbox($attr, $data->{$attr}, array_merge($value['config'], ['data-id' => $data->id]));
                }, 'filter' => false, 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
            case Content::ATTR_TYPE_DROPDOWN:
                $columns[] = ['attribute' => $attr, 'value' => function ($data) use($attr, $value) {
                    return isset($value['items'][$data->{$attr}]) ? $value['items'][$data->{$attr}] : '';
                }, 'filterType' => GridView::FILTER_SELECT2, 'filter' => $value['items'], 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => '---'], 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
            case Content::ATTR_TYPE_HIDE:
                $columns[] = ['attribute' => $attr, 'visible' => false];
                break;
            default:
                $columns[] = ['attribute' => $attr, 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
        }
    }
}
if (class_exists('\\stepancher\\adminlteTheme\\config\\AnminLteThemeConfig')) {
    DynaGrid::begin(\yii\helpers\ArrayHelper::merge(\stepancher\adminlteTheme\config\AnminLteThemeConfig::getDefaultConfigDynagrid(), ['columns' => $columns, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['before' => Html::a('<i class="btn-label glyphicon fa fa-plus"></i> &nbsp&nbsp' . \Yii::t('content', 'Create'), ['create'], ['class' => 'btn btn-labeled btn-success no-margin-t']), 'after' => Html::a('<i class="icon glyphicon fa fa-trash"></i> &nbsp&nbspУдалить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_ARCHIVE, 'class' => 'btn btn-danger btn-multiple', 'title' => 'Удалить выбранные записи']) . Html::a('<i class="icon fa fa-trash"></i> Перейти в корзину', '/admin/' . $this->context->module->id . '/archives', ['class' => 'btn btn-warning pull-right']) . '<div class="pull-right">{pager}</div>'], 'options' => ['id' => 'grid', 'data-url' => '/admin/' . $this->context->module->id . '/group-action']], 'options' => ['id' => 'dynagrid-' . $this->context->module->id]]));
} else {
    DynaGrid::begin(['columns' => $columns, 'toggleButtonGrid' => ['label' => '<i class="glyphicon glyphicon-wrench"></i> &nbsp&nbspНастройки'], 'toggleButtonFilter' => ['label' => '<i class="glyphicon glyphicon-filter"></i> &nbsp&nbsp Фильтры'], 'toggleButtonSort' => ['label' => '<i class="glyphicon glyphicon-sort"></i> &nbsp&nbsp Сортировка'], 'storage' => DynaGrid::TYPE_DB, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i> Сбросить', [''], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Обновить'])], ['content' => '{dynagridFilter}{dynagridSort}{dynagrid}{toggleData}'], '{export}'], 'export' => ['label' => 'Экспорт'], 'panel' => ['footer' => false, 'before' => Html::a('<i class="btn-label glyphicon fa fa-plus"></i> &nbsp&nbsp' . \Yii::t('content', 'Create'), ['create'], ['class' => 'btn btn-labeled btn-success no-margin-t']), 'after' => Html::a('<i class="icon glyphicon fa fa-trash"></i> &nbsp&nbspУдалить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_ARCHIVE, 'class' => 'btn btn-danger btn-multiple', 'title' => 'Удалить выбранные записи']) . Html::a('<i class="icon fa fa-trash"></i> Перейти в корзину', '/admin/' . $this->context->module->id . '/archives', ['class' => 'btn btn-warning pull-right']) . '<div class="pull-right">{pager}</div>'], 'options' => ['id' => 'grid', 'data-url' => '/admin/' . $this->context->module->id . '/group-action']], 'options' => ['id' => 'dynagrid-' . $this->context->module->id]]);
}
DynaGrid::end();
?>

                $columns[] = ['attribute' => $attr, 'format' => ['image', ['width' => '100']], 'value' => function ($model) {
                    return $model->getImageUrl() ? $model->getImageUrl() : '';
                }, 'filter' => false, 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
            case Content::ATTR_TYPE_DATE:
                $columns[] = ['attribute' => $attr, 'format' => ['raw', ['width' => '100']], 'value' => function ($data) use($attr) {
                    return Yii::$app->formatter->asDateTime($data->{$attr}, Yii::$app->formatter->dateFormat) . ' <small style="color:gray;">' . Yii::$app->formatter->asDateTime($data->{$attr}, Yii::$app->formatter->timeFormat) . '</small>';
                }, 'filter' => false, 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
            case Content::ATTR_TYPE_BOOLEAN:
                $columns[] = ['attribute' => $attr, 'format' => 'raw', 'value' => function ($data) use($attr) {
                    return Html::checkbox($attr, $data->{$attr});
                }, 'filter' => false, 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
            case Content::ATTR_TYPE_DROPDOWN:
                $columns[] = ['attribute' => $attr, 'value' => function ($data) use($attr, $value) {
                    return isset($value['items'][$data->{$attr}]) ? $value['items'][$data->{$attr}] : '';
                }, 'filterType' => GridView::FILTER_SELECT2, 'filter' => $value['items'], 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => '---'], 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
            default:
                $columns[] = ['attribute' => $attr, 'visible' => isset($value['visible']) ? $value['visible'] : true];
                break;
        }
    }
}
if (class_exists('\\stepancher\\adminlteTheme\\config\\AnminLteThemeConfig')) {
    DynaGrid::begin(\yii\helpers\ArrayHelper::merge(\stepancher\adminlteTheme\config\AnminLteThemeConfig::getDefaultConfigDynagrid(), ['columns' => $columns, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['after' => Html::a('<i class="icon glyphicon fa fa-reply"></i> &nbsp&nbspВосстановить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_UNARCHIVE, 'class' => 'btn btn-primary btn-multiple', 'title' => 'Восстановить выбранные записи']) . Html::a('<i class="icon glyphicon fa fa-trash"></i> &nbsp&nbspУдалить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_DELETE, 'class' => 'btn btn-danger btn-multiple', 'title' => 'Удалить выбранные записи']) . '<div class="pull-right">{pager}</div>'], 'options' => ['id' => 'grid', 'data-url' => '/admin/' . $this->context->module->id . '/group-action']], 'options' => ['id' => 'dynagrid-archive-' . $this->context->module->id]]));
} else {
    DynaGrid::begin(['columns' => $columns, 'toggleButtonGrid' => ['label' => '<i class="glyphicon glyphicon-wrench"></i> &nbsp&nbspНастройки'], 'toggleButtonFilter' => ['label' => '<i class="glyphicon glyphicon-filter"></i> &nbsp&nbsp Фильтры'], 'toggleButtonSort' => ['label' => '<i class="glyphicon glyphicon-sort"></i> &nbsp&nbsp Сортировка'], 'storage' => DynaGrid::TYPE_DB, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i> Сбросить', [''], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Обновить'])], ['content' => '{dynagridFilter}{dynagridSort}{dynagrid}{toggleData}'], '{export}'], 'export' => ['label' => 'Экспорт'], 'panel' => ['footer' => false, 'after' => Html::a('<i class="icon glyphicon fa fa-reply"></i> &nbsp&nbspВосстановить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_UNARCHIVE, 'class' => 'btn btn-primary btn-multiple', 'title' => 'Восстановить выбранные записи']) . Html::a('<i class="icon glyphicon fa fa-trash"></i> &nbsp&nbspУдалить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_DELETE, 'class' => 'btn btn-danger btn-multiple', 'title' => 'Удалить выбранные записи']) . '<div class="pull-right">{pager}</div>'], 'options' => ['id' => 'grid', 'data-url' => '/admin/' . $this->context->module->id . '/group-action']], 'options' => ['id' => 'dynagrid-archive-' . $this->context->module->id]]);
}
DynaGrid::end();
$this->title = Module::t('comments', 'BACKEND_INDEX_TITLE');
$this->params['subtitle'] = Module::t('comments', 'BACKEND_INDEX_SUBTITLE');
$this->params['breadcrumbs'] = [$this->title];
$columns = [['class' => 'kartik\\grid\\SerialColumn', 'order' => DynaGrid::ORDER_FIX_LEFT], 'parent_id', 'model_id', ['attribute' => 'model_class', 'value' => function ($model) {
    return $model->class->name;
}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => $modelArray, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => '---']], 'content', ['attribute' => 'status_id', 'format' => 'html', 'value' => function ($model) {
    $class = 'label-success';
    switch ($model->status_id) {
        case $model::STATUS_ACTIVE:
            $class = 'label-success';
            break;
        case $model::STATUS_MODER:
            $class = 'label-warning';
            break;
        default:
            $class = 'label-danger';
            break;
    }
    return '<span class="label ' . $class . '">' . $model->status . '</span>';
}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => $statusArray, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => '---']], ['attribute' => 'created_at', 'format' => 'date'], ['attribute' => 'updated_at', 'format' => 'date'], ['class' => 'yii\\grid\\ActionColumn', 'template' => '<nobr>{update}{delete}</nobr>', 'buttons' => ['update' => function ($url, $model) {
    return Html::a('<span class="icon fa fa-edit"></span>', $url, ['class' => 'btn btn-sm btn-primary']);
}, 'delete' => function ($url, $model) {
    return Html::a('<span class="icon fa fa-trash"></span>', $url, ['class' => 'btn btn-sm btn-danger isDel', 'data-method' => 'post', 'data-pjax' => 0]);
}]]];
$dynaGridOptions = ['columns' => $columns, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['after' => '<div class="pull-right">{pager}</div>']], 'options' => ['id' => 'dynagrid-comments']];
if (class_exists('\\stepancher\\adminlteTheme\\config\\AnminLteThemeConfig')) {
    DynaGrid::begin(\yii\helpers\ArrayHelper::merge(\stepancher\adminlteTheme\config\AnminLteThemeConfig::getDefaultConfigDynagrid(), $dynaGridOptions));
} else {
    DynaGrid::begin(['columns' => $columns, 'toggleButtonGrid' => ['label' => '<i class="glyphicon glyphicon-wrench"></i> &nbsp&nbspНастройки'], 'toggleButtonFilter' => ['label' => '<i class="glyphicon glyphicon-filter"></i> &nbsp&nbsp Фильтры'], 'toggleButtonSort' => ['label' => '<i class="glyphicon glyphicon-sort"></i> &nbsp&nbsp Сортировка'], 'storage' => DynaGrid::TYPE_DB, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i> Сбросить', [''], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Обновить'])], ['content' => '{dynagridFilter}{dynagridSort}{dynagrid}{toggleData}'], '{export}'], 'export' => ['label' => 'Экспорт'], 'panel' => ['after' => false]], 'options' => ['id' => 'dynagrid-comments']]);
}
DynaGrid::end();