<?php

use yii\helpers\Html;
use yii\widgets\Menu;
use yii\widgets\ActiveForm;

$this->title = 'VRF';
$this->params['breadcrumbs'] = [
    'Mikrotik',
    $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 $form = ActiveForm::begin(['id' => 'form-Rules']); ?>
            <label class="control-label" for="routes-vrf">Routing Mark</label>
            <input type="text" class="form-control" name="Vrf[routing_mark]" list="routing_mark" value=<?php echo $model->routing_mark ?>>
            <datalist id="routing_mark">

                <option value="main">main</option>";
                <?php
                foreach ($packetMark['routing'] as $value) {
                    echo "<option value=$value>$value</option>";
                }
                ?>


            </datalist>
            </br>
            <?= $form->field($model, 'interfaces')->dropDownList($intName, ['prompt'=>' ','multiple' => 'multiple']); ?>
            <?= $form->field($model, 'route_distinguisher')->label('Route Distinguisher'); ?>
            <?= $form->field($model, 'import_route_targets')->label('Import Route Targets'); ?>
            <?= $form->field($model, 'export_route_targets')->label('Export Route Targets'); ?>
            <?php
            if ($action == 'update') {
                if ($model->disabled == 'true') {
                    $action_e = 'enable';
                } else {
                    $action_e = 'disable';
                }
                echo Html::submitButton('Update', ['class' => 'btn btn-primary', 'name' => 'create-button']);
                echo Html::a('' . ucfirst($action_e) . '', [$action_e, 'id' => $model->id], ['class' => 'btn btn-primary']);
            } else {
                echo Html::submitButton('Create', ['class' => 'btn btn-primary', 'name' => 'create-button']);
            }
            ?>
        </div>
        <?php ActiveForm::end();
        ?> 
    </div>
</div>
</div>