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

<div class="delivery-form">
    
    <?php $form = ActiveForm::begin(); ?>
    
    <?= $form->field($model, 'parent_id')
             ->dropDownList($parent_items, [
                 'prompt' => "Выберите вид доставки..."
             ]) ?>
    
    <?= $form->field($model, 'value')
             ->textInput() ?>
    
    <?= $form->field($model, 'sort')
             ->textInput() ?>
    
    <?= LanguageForm::widget([
        'model_langs' => $model_langs,
        'formView'    => '@backend/views/delivery/_form_language',
        'form'        => $form,
    ]) ?>
    
    <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>
