<?php
/**
 * @var \kernel\app_modules\card\models\CardTemplate $model
 */

use kernel\app_modules\card\models\Card;

$form = new \itguild\forms\ActiveForm();
$form->beginForm(isset($model) ? "/admin/card_template/edit/" . $model->id : "/admin/card_template", 'multipart/form-data');

// Пример формы:


$form->field(\itguild\forms\inputs\TextInput::class, 'title', [
    'class' => "form-control",
    'placeholder' => 'Название',
    'value' => $model->title ?? ''
])
    ->setLabel("Заголовок")
    ->render();

$form->field(\itguild\forms\inputs\File::class, 'path', [
    'class' => "form-control",
    'placeholder' => 'Путь к файлу',
    'value' => $model->path ?? ''
])
    ->setLabel(\kernel\app_modules\card\models\CardTemplate::labels()['path'])
    ->render();

$form->field(class: \itguild\forms\inputs\Select::class, name: "status", params: [
    'class' => "form-control",
    'value' => $model->status ?? ''
])
    ->setLabel("Статус")
    ->setOptions(\kernel\app_modules\card\models\CardTemplate::getStatus())
    ->render();


?>
    <div class="row">
        <div class="col-sm-2">
            <?php
            $form->field(\itguild\forms\inputs\Button::class, name: "btn-submit", params: [
                'class' => "btn btn-primary ",
                'value' => 'Отправить',
                'typeInput' => 'submit'
            ])
                ->render();
            ?>
        </div>
        <div class="col-sm-2">
            <?php
            $form->field(\itguild\forms\inputs\Button::class, name: "btn-reset", params: [
                'class' => "btn btn-warning",
                'value' => 'Сбросить',
                'typeInput' => 'reset'
            ])
                ->render();
            ?>
        </div>
    </div>
<?php
$form->endForm();
