-
field(\itguild\forms\inputs\Button::class, name: "btn-submit", params: [
- 'class' => "btn btn-primary ",
- 'value' => 'Отправить',
- 'typeInput' => 'submit'
+
+
+ Custom Title
+
+
+ @php
+ $form = new \itguild\forms\ActiveForm();
+ $form->beginForm(isset($model) ? "/admin/user/edit/" . $model->id : "/admin/user/store", enctype: 'multipart/form-data');
+
+ $form->field(class: \itguild\forms\inputs\TextInput::class, name: "username", params: [
+ 'class' => "form-control",
+ 'placeholder' => 'Логин',
+ 'value' => $model->username ?? ''
])
+ ->setLabel("Логин")
->render();
- ?>
-
-
- field(\itguild\forms\inputs\Button::class, name: "btn-reset", params: [
- 'class' => "btn btn-warning",
- 'value' => 'Сбросить',
- 'typeInput' => 'reset'
+
+ $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();
+ @endphp
+
+
+
+ @php
+ $form->field(\itguild\forms\inputs\Button::class, name: "btn-submit", params: [
+ 'class' => "btn btn-primary ",
+ 'value' => 'Отправить',
+ 'typeInput' => 'submit'
+ ])
+ ->render();
+ @endphp
+
+
+ @php
+ $form->field(\itguild\forms\inputs\Button::class, name: "btn-reset", params: [
+ 'class' => "btn btn-warning",
+ 'value' => 'Сбросить',
+ 'typeInput' => 'reset'
+ ])
+ ->render();
+ @endphp
+ @csrf
+ @php
+ $form->endForm();
+ @endphp
+
-
-@csrf
-endForm();
+
+
diff --git a/resources/views/user/index.blade.php b/resources/views/user/index.blade.php
index 582467d..7f25bad 100644
--- a/resources/views/user/index.blade.php
+++ b/resources/views/user/index.blade.php
@@ -35,8 +35,22 @@ $table->columns([
return (new DateTimeImmutable($data))->format("d-m-Y");
}
]);
+//$table->beforePrint(function () {
+// return IconBtnCreateWidget::create(['url' => '/admin/user/create'])->run();
+//});
+$table->beforePrint(function () {
+ return "
";
+});
+$table->addAction(function($row) {
+ return "
";
+});
+$table->addAction(function($row) {
+ return "
";
+});
+$table->addAction(function($row) {
+ return "
";
+});
$table->create();
-//$table->render();
?>
diff --git a/resources/views/user/view.blade.php b/resources/views/user/view.blade.php
index 0f711dc..9b07488 100644
--- a/resources/views/user/view.blade.php
+++ b/resources/views/user/view.blade.php
@@ -31,4 +31,15 @@ $table->rows([
}
]);
$table->create();
-$table->render();
+?>
+
+
+
+Custom Title
+
+
+@php
+ $table->render();
+@endphp
+
+
diff --git a/resources/views/widgets/action_button_widget.blade.php b/resources/views/widgets/action_button_widget.blade.php
new file mode 100644
index 0000000..944276e
--- /dev/null
+++ b/resources/views/widgets/action_button_widget.blade.php
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+ Custom Title
+
+
+ {{ $label }}
+
+
diff --git a/resources/views/widgets/icon_btn_create_widget.blade.php b/resources/views/widgets/icon_btn_create_widget.blade.php
new file mode 100644
index 0000000..36bb49e
--- /dev/null
+++ b/resources/views/widgets/icon_btn_create_widget.blade.php
@@ -0,0 +1 @@
+{{ $label }}