<?php

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

/* @var $this View */
$model = new yii\base\DynamicModel(['id', 'code', 'name', 'active', 'order_by']);
$this->title = Yii::t('language', 'Add new language');
$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 add new language') ?></small>
                </div>
                <div class="ibox-content">
                    <?php
                    $form = ActiveForm::begin([
                                'id' => 'create-form',
                                'options' => ['role' => 'form', 'method' => 'POST'],
                                'action' => ['language/create', 'lang' => Yii::$app->language],
                            ])
                    ?>
                    <?= $form->field($model, 'code')->textInput() ?>
                    <?= $form->field($model, 'name')->textInput() ?>

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

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