<?php

use yii\helpers\Html;
use yii\grid\GridView;
use app\models\Admins; 

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$actCol;
$count = $dataProvider->getTotalCount();
$count < 2 ? $actCol = ['class' => 'yii\grid\ActionColumn', 'template' => '{view} {update}'] :
$actCol = ['class' => 'yii\grid\ActionColumn', 'template' => '{view} {update} {delete}'];

$this->title = Yii::t('app', 'Admins');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="admins-index">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a(Yii::t('app', 'Create Admins'), ['create'], ['class' => 'btn btn-success']) ?>
    </p>


    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            'email:email',
            'username',
            $actCol,
        ],
    ]); ?>

</div>
