MicroFrameWork/kernel/modules/option/views/form.php
2024-09-23 17:03:42 +03:00

68 lines
1.8 KiB
PHP

<?php
/**
* @var Option $model
*/
use itguild\forms\ActiveForm;
use kernel\modules\option\models\Option;
$form = new ActiveForm();
$form->beginForm(isset($model) ? "/admin/option/edit/" . $model->id : "/admin/option");
$form->field(\itguild\forms\inputs\TextInput::class, 'key', [
'class' => "form-control",
'placeholder' => 'Ключ',
'value' => $model->key ?? ''
])
->setLabel("Ключ")
->render();
$form->field(\itguild\forms\inputs\TextInput::class, 'value', [
'class' => "form-control",
'placeholder' => 'Значение',
'value' => $model->value ?? ''
])
->setLabel("Значение")
->render();
$form->field(\itguild\forms\inputs\TextInput::class, 'label', [
'class' => "form-control",
'placeholder' => "Заголовок",
'value' => $model->label ?? ''
])
->setLabel("Заголовок")
->render();
$form->field(\itguild\forms\inputs\Select::class, 'status', [
'class' => "form-control",
'value' => $model->status ?? ''
])
->setLabel("Статус")
->setOptions(Option::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();