fix slider
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* @var Slider $slider
|
||||
* @var Slider $model
|
||||
*/
|
||||
|
||||
use kernel\app_modules\slider\models\Slider;
|
||||
|
@ -23,6 +23,15 @@ $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) {
|
||||
|
@ -20,6 +20,16 @@ $table->beforePrint(function () use ($slider) {
|
||||
$btn .= \kernel\widgets\IconBtn\IconBtnDeleteWidget::create(['url' => "/admin/slider/delete/" . $slider->id])->run();
|
||||
return $btn;
|
||||
});
|
||||
|
||||
$entityRelation = new \kernel\EntityRelation();
|
||||
$additionals = $entityRelation->getEntityAdditionalProperty("slider", $slider);
|
||||
|
||||
foreach ($additionals as $key => $additional) {
|
||||
$table->addRow($key, function () use ($additional) {
|
||||
return $additional;
|
||||
}, ['after' => 'status']);
|
||||
}
|
||||
|
||||
$table->rows([
|
||||
'status' => (function ($data) {
|
||||
return \kernel\app_modules\slider\models\Slider::getStatus()[$data];
|
||||
|
Reference in New Issue
Block a user