crud menu

This commit is contained in:
2024-08-30 16:14:31 +03:00
parent 5b4676a4c0
commit c325b156bd
28 changed files with 442 additions and 132 deletions

View File

@ -4,7 +4,6 @@
*/
use app\models\Post;
use app\models\User;
$form = new \itguild\forms\ActiveForm();
$form->beginForm(isset($model) ? "/admin/post/edit/" . $model->id : "/admin/post");
@ -18,7 +17,6 @@ $form->field(class: \itguild\forms\inputs\TextArea::class, name: "content", para
->setLabel("Пост")
->render();
$form->field(class: \itguild\forms\inputs\Select::class, name: "user_id", params: [
//$form->field(class: \itguild\forms\inputs\Select::class, name: "username", params: [
'class' => "form-control",
'value' => $model->user_id ?? ''
])

View File

@ -7,9 +7,9 @@
use app\models\Post;
use app\models\User;
use app\tables\columns\PostDeleteActionColumn;
use app\tables\columns\PostEditActionColumn;
use app\tables\columns\PostViewActionColumn;
use app\tables\columns\post\PostDeleteActionColumn;
use app\tables\columns\post\PostEditActionColumn;
use app\tables\columns\post\PostViewActionColumn;
use Itguild\EloquentTable\EloquentDataProvider;
use Itguild\EloquentTable\ListEloquentTable;
use kernel\IGTabel\btn\PrimaryBtn;

View File

@ -11,20 +11,6 @@ use kernel\IGTabel\btn\DangerBtn;
use kernel\IGTabel\btn\PrimaryBtn;
use kernel\IGTabel\btn\SuccessBtn;
//$dataProvider = new ViewJsonTableEloquentModel($content, [
// 'params' => ["class" => "table table-bordered", "border" => "2"],
// 'baseUrl' => "/admin/user",
//]);
//$table = new ViewJsonTable($dataProvider->getJson());
//$table->beforeTable(function () use ($content) {
// $btn = PrimaryBtn::create("Список", "/admin/post")->fetch();
// $btn .= SuccessBtn::create("Редактировать", "/admin/post/update/" . $content->id)->fetch();
// $btn .= DangerBtn::create("Удалить", "/admin/post/delete/" . $content->id)->fetch();
// return $btn;
//});
//$table->create();
//$table->render();
$table = new ViewEloquentTable(new ViewJsonTableEloquentModel($content, [
'params' => ["class" => "table table-bordered", "border" => "2"],
'baseUrl' => "/admin/post",