beginForm(isset($model) ? "/admin/user/edit/" . $model->id : "/admin/user", enctype: 'multipart/form-data'); $form->field(class: \itguild\forms\inputs\TextInput::class, name: "username", params: [ 'class' => "form-control", 'placeholder' => 'Логин', 'value' => $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(); if (!empty($model->user_photo)){ echo "
"; } $form->field(class: \itguild\forms\inputs\File::class, name: "user_photo", params: [ 'class' => "form-control", 'value' => $model->user_photo ?? '' ]) ->setLabel("Фото профиля") ->render(); $entityRelations = new \kernel\EntityRelation(); if (!isset($model)) { $model = new User(); } $entityRelations->renderEntityAdditionalPropertyFormBySlug("user", $model); ?>