<?php

use backend\models\MasterKompetensi;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\grid\ActionColumn;
use yii\grid\GridView;

/** @var yii\web\View $this */
/** @var backend\models\MasterKompetensiSearch $searchModel */
/** @var yii\data\ActiveDataProvider $dataProvider */

$this->title = 'Master Kompetensis';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="master-kompetensi-index">

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

    <p>
        <?= Html::a('Create Master Kompetensi', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            // 'SKEMA_UUID',
            [
                'label'     => 'Skema',
                'value'     => function ($data) {
                    return $data->masterSkema->SKEMA_NAMA;
                }
            ],
            'MASKOM_UUID',
            'MASKOM_KODE',
            'MASKOM_JUDUL',
            // 'CREATED',
            //'USERNAME',
            [
                'class' => ActionColumn::className(),
                'urlCreator' => function ($action, MasterKompetensi $model, $key, $index, $column) {
                    return Url::toRoute([$action, 'MASKOM_UUID' => $model->MASKOM_UUID]);
                 }
            ],
        ],
    ]); ?>


</div>
