<?php

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

?>

<div>
    <?php $form = ActiveForm::begin([
        'options' => ['id' => 'create-view'],
    ]); ?>
    
    <?= $form->field($model, 'formId')->widget(Select2::class, [
        'name' => 'form',
        'data' => ArrayHelper::map($forms, 'id', 'name'),
        'options' => [
            'id' => 'form',
            'placeholder' => 'Select form',
        ],
    ])->label('Select form to create campaign for') ?>

    <div class="center-elements" style="margin-top: 20px;">
        <?= Html::submitButton(Yii::t('app', 'Ok'), ['class' => 'btn btn-success btn-expanded']) ?>
    </div>

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