<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\grid\GridView;
use yii\widgets\Menu;
use yii\bootstrap\Tabs;

$this->title = 'DNS Cache';
$this->params['breadcrumbs'] = [
    'Mikrotik',
    'IP',
    $this->title,];
?>

<div class="site-plugins">
    <div class="row">
        <div class="col-lg-3">
            <?php
            echo Menu::widget($menu);
            ?> 
        </div>
        <div class="col-md-9">
            <h1 style="margin-top: 0px"><?= Html::encode($this->title) ?></h1>
            <?php
            $tabs[] = ['label' => 'DNS Cache', 'content' => GridView::widget([
                    'dataProvider' => $provider,
                    'id' => 'DNS Cache',
                    'columns' => [
                        ['attribute' => 'name',
                            'format' => 'text',
                            'label' => 'Name'],
                        'type:text:Type',
                        'data:text:Data',
                        'ttl:text:TTL',
                        [
                            'class' => 'yii\grid\ActionColumn', 'template' => '',
                            //'class' => 'yii\grid\CheckboxColumn',
                            'controller' => 'mikrotik/ip/dns/dnscache',
                            'header' => Html::button('Flush Cache', ['class' => 'btn btn-primary', 'name' => 'add-button', 'onclick' =>
                                'js:document.location.href="' . Url::toRoute('mikrotik/ip/dns/dnscache/flush') . '"']),
                        ],
                    ],
                    'showFooter' => false,
                ])
            ];


            echo Tabs::widget([
                'items' => $tabs]);
            //echo Html::a('<span class="btn-label">DHCP Config</span>', ['config', 'id' => $model->id], ['class' => 'btn btn-primary']);
            ?>
        </div>
    </div>
</div>