igfs/app/modules/module_shop/views/form.php
2024-10-16 16:06:25 +03:00

93 lines
2.7 KiB
PHP

<?php
/**
* @var ModuleShop $model
*/
use app\modules\module_shop\models\ModuleShop;
$form = new \itguild\forms\ActiveForm();
$form->beginForm(isset($model) ? "/admin/module_shop/edit/" . $model->id : "/admin/module_shop");
$form->field(\itguild\forms\inputs\TextInput::class, 'name', [
'class' => "form-control",
'placeholder' => 'Название',
'value' => $model->name ?? ''
])
->setLabel("Название")
->render();
$form->field(\itguild\forms\inputs\TextInput::class, 'author', [
'class' => "form-control",
'placeholder' => 'Автор',
'value' => $model->author ?? ''
])
->setLabel("Автор")
->render();
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "version", params: [
'class' => "form-control",
'placeholder' => 'Версия',
'value' => $model->version ?? ''
])
->setLabel("Версия")
->render();
$form->field(class: \itguild\forms\inputs\TextArea::class, name: "description", params: [
'class' => "form-control",
'placeholder' => 'Описание',
'rows' => '10',
'value' => $model->description ?? ''
])
->setLabel("Описание")
->render();
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "dependence", params: [
'class' => "form-control",
'placeholder' => 'Зависимости',
'value' => $model->dependence ?? ''
])
->setLabel("Зависимости")
->render();
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "path_to_archive", params: [
'class' => "form-control",
'placeholder' => 'Путь к файлу модуля',
'value' => $model->path_to_archive ?? ''
])
->setLabel("Путь к файлу модуля")
->render();
$form->field(class: \itguild\forms\inputs\Select::class, name: "status", params: [
'class' => "form-control",
'value' => $model->status ?? ''
])
->setLabel("Статус")
->setOptions(ModuleShop::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();