2024-07-25 13:23:50 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @var User $model
|
|
|
|
*/
|
2024-07-24 17:22:59 +03:00
|
|
|
|
2024-09-06 16:53:20 +03:00
|
|
|
use kernel\modules\user\models\User;
|
2024-07-24 17:22:59 +03:00
|
|
|
|
2024-07-25 13:23:50 +03:00
|
|
|
$form = new \itguild\forms\ActiveForm();
|
2024-12-03 12:13:18 +03:00
|
|
|
$form->beginForm(isset($model) ? "/admin/user/edit/" . $model->id : "/admin/user", enctype: 'multipart/form-data');
|
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' => 'Логин',
|
2024-07-25 16:15:18 +03:00
|
|
|
'value' => $model->username ?? ''
|
2024-07-25 13:23:50 +03:00
|
|
|
])
|
|
|
|
->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();
|
|
|
|
|
2024-12-25 16:32:23 +03:00
|
|
|
if (!empty($model->user_photo)){
|
|
|
|
echo "<div><img src='$model->user_photo' width='200px'></div>";
|
|
|
|
}
|
|
|
|
$form->field(class: \itguild\forms\inputs\File::class, name: "user_photo", params: [
|
|
|
|
'class' => "form-control",
|
|
|
|
'value' => $model->user_photo ?? ''
|
|
|
|
])
|
|
|
|
->setLabel("Фото профиля")
|
|
|
|
->render();
|
|
|
|
|
2024-12-03 10:51:22 +03:00
|
|
|
$entityRelations = new \kernel\EntityRelation();
|
|
|
|
if (!isset($model)) {
|
|
|
|
$model = new User();
|
|
|
|
}
|
|
|
|
$entityRelations->renderEntityAdditionalPropertyFormBySlug("user", $model);
|
2024-07-25 13:23:50 +03:00
|
|
|
?>
|
|
|
|
<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();
|