<?php
    
    use common\modules\language\widgets\LanguageForm;
    use common\modules\product\models\ProductUnit;
    use common\modules\product\models\ProductUnitLang;
    use yii\helpers\Html;
    use yii\web\View;
    use yii\widgets\ActiveForm;
    
    /**
     * @var View              $this
     * @var ProductUnit       $model
     * @var ProductUnitLang[] $model_langs
     * @var ActiveForm        $form
     */
?>

<div class="product-unit-form">
    
    <?php $form = ActiveForm::begin(); ?>
    
    <?= $form->field($model, 'is_default')
             ->checkbox() ?>
    
    <?= LanguageForm::widget([
        'model_langs' => $model_langs,
        'form'        => $form,
        'formView'    => '@common/modules/product/views/product-unit/_form_language',
    ]) ?>
    
    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? Yii::t('product', 'Create') : Yii::t('product', 'Update'), [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary' ]) ?>
    </div>
    
    <?php ActiveForm::end(); ?>

</div>
