MicroFrameWork/views/admin/user/form.php

60 lines
1.5 KiB
PHP
Raw Normal View History

2024-07-25 13:23:50 +03:00
<?php
/**
* @var User $model
*/
2024-07-24 17:22:59 +03:00
2024-07-25 13:23:50 +03:00
use app\models\User;
2024-07-24 17:22:59 +03:00
2024-07-25 13:23:50 +03:00
$form = new \itguild\forms\ActiveForm();
$form->beginForm(isset($model) ? "/admin/user/edit/" . $model->id : "/admin/user");
2024-07-24 17:22:59 +03:00
2024-07-25 13:23:50 +03:00
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "username", params: [
'class' => "form-control",
'placeholder' => 'Логин',
'model' => $model->username ?? ''
])
->setLabel("Логин")
->render();
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "password", params: [
'class' => "form-control",
'type' => "password",
])
->setLabel("Пароль")
->render();
$form->field(class: \itguild\forms\inputs\TextInput::class, name: "email", params: [
'class' => "form-control",
'type' => "email",
'placeholder' => 'test@mail.ru',
'value' => $model->email ?? ''
])
->setLabel("Email")
->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();