igfs/resources/tmp/ad/6061f1739a4083115f9124a9eefbc9e4/kernel/views/form.php

59 lines
1.6 KiB
PHP

<?php
/**
* @var Tag $model
*/
use kernel\app_modules\tag\models\Tag;
$form = new \itguild\forms\ActiveForm();
$form->beginForm(isset($model) ? "/admin/tag/edit/" . $model->id : "/admin/tag");
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "label", params: [
'class' => "form-control",
'placeholder' => 'Заголовок',
'value' => $model->label ?? ''
])
->setLabel("Заголовок")
->render();
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "entity", params: [
'class' => "form-control",
'placeholder' => 'Сущность',
'value' => $model->entity ?? ''
])
->setLabel("Сущность")
->render();
$form->field(\itguild\forms\inputs\Select::class, 'status', [
'class' => "form-control",
'value' => $model->status ?? ''
])
->setLabel("Статус")
->setOptions(Tag::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();