$page_number, 'perPage' => 8, 'params' => ["class" => "table table-bordered", "border" => "2"], 'baseUrl' => "/admin/slider", ])); $table->beforePrint(function () { return IconBtnCreateWidget::create(['url' => '/admin/slider/create'])->run(); }); $entityRelation = new \kernel\EntityRelation(); $additionals = $entityRelation->getEntityRelationsBySlug("slider"); foreach ($additionals as $additional) { $table->addColumn($additional, $additional, function ($id) use ($entityRelation, $additional) { return $entityRelation->getAdditionalPropertyByEntityId("slider", $id, $additional); }); } $table->columns([ "status" => [ "value" => function ($cell) { return Slider::getStatus()[$cell]; }] ]); $table->addAction(function($row) { return IconBtnViewWidget::create(['url' => '/admin/slider/view/' . $row['id']])->run(); }); $table->addAction(function($row) { return IconBtnEditWidget::create(['url' => '/admin/slider/update/' . $row['id']])->run(); }); $table->addAction(function($row) { return IconBtnDeleteWidget::create(['url' => '/admin/slider/delete/' . $row['id']])->run(); }); $table->create(); $table->render();