<?php
/**
 * @var array $data
 */

$table_info = [
    "meta" => [
        "rows" => ["preview" => "Превью", "name" => "Название", "version" => "Версия", "description" => "Описание"],
        "params" => ["class" => "table table-bordered"],
        "baseUrl" => "/admin/settings/themes",
    ],
    "data" => $data
];

$table = new \Itguild\Tables\ViewJsonTable(json_encode($table_info, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
$table->rows([
    'preview' => function ($data) {
        return "<img src='$data' width='500px'>";
    }
]);
$table->beforePrint(function () {
    return \kernel\widgets\IconBtn\IconBtnListWidget::create(['url' => '/admin/settings/themes'])->run();
});
$table->create();
$table->render();