<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm; 
use backend\models\Termin;
use kartik\select2\Select2;
use yii\helpers\ArrayHelper;

/* @var $this yii\web\View */
/* @var $model backend\models\Termin */
/* @var $form yii\widgets\ActiveForm */
 
?>

<div class="termin-form">

    <?php $form = ActiveForm::begin(); ?>
 
	<?= $form->field($model_pid->termin, 'termin_id')->widget(Select2::classname(), 
        [
            'data' => ArrayHelper::map((new Termin)->finInfo([  
                    'show_all' => true,  
            	]),
	           'termin_id',
	           'termin_title'
            ),
	        'options' => ['placeholder' => 'Select a state ...'],
            'pluginOptions' => [
                'allowClear' => true
            ],
        ]); 
    ?>
	 
    <?= $form->field($model, 'termin_name')->textInput(['maxlength' => true]) ?> 
  
	<?= $form->field($model_lang, 'termin_title')->textInput() ?>
 
	<?= $form->field($model_lang, 'termin_alias')->textInput() ?>
 
 	<?= Html::activeHiddenInput ($model_lang, 'language_id', [
 	    'value' => ($model_lang->language_id != 0 ? $model_lang->language_id : Yii::$app->params['language_id']),
 	]) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

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

</div>
