<?php

use yii\helpers\Html;
use yii\web\View;
use yii\widgets\ActiveForm;

/* @var $this View */
$model = new yii\base\DynamicModel(['id' => 1, 'code' => 'lv', 'name' => 'Latviešu', 'active' => 1, 'order_by' => 0]);
$this->title = Yii::t('language', 'Edit language: '). $model->name;
$this->params['breadcrumbs'][] = $this->title;
?>
<div>
    <div class="row">
        <div class="col-lg-6">
            <div class="ibox animated fadeInUp">
                <div class="ibox-title">
                    <h5><?= Html::encode($this->title) ?></h5>
                    <small class="pull-right"><?= Yii::t('language', 'By submitting this form, you can edit a language') ?></small>
                </div>
                <div class="ibox-content">
                    <?php
                    $form = ActiveForm::begin([
                                'id' => 'edit-form',
                                'options' => ['role' => 'form', 'method' => 'POST'],
                                'action' => ['language/edit', 'lang' => Yii::$app->language, 'id' => $model->id],
                            ])
                    ?>
                    <?= $form->field($model, 'code')->textInput() ?>
                    <?= $form->field($model, 'name')->textInput() ?>

                    <div class="form-group">
                        <?= Html::submitButton(Yii::t('general', 'Edit'), ['class' => 'btn btn-primary', 'name' => 'submit-button']) ?>
                    </div>

                    <?php ActiveForm::end(); ?>
                </div>
            </div>
        </div>
    </div>
</div>
