add integer format

This commit is contained in:
2024-08-13 14:30:00 +03:00
parent 19e994ef38
commit 96b249eb51
4 changed files with 25 additions and 8 deletions

View File

@ -7,22 +7,23 @@ use Itguild\Tables\ListJsonTable;
$json = file_get_contents('simple.json');
$table = new ListJsonTable($json);
//$table->columns([
$table->columns([
"created_at" => [
"format" => "date:Y-m-d",
"format" => "date:Y-m-d"
],
'description' => [
"format" => "html",
"style" => ["width" => "300px"],
"filter" => '',
"filter" => function () {},
"value" => function ($cell) {
return "<span style='color: sienna'>$cell</span>";
}
],
'status' => function ($cell) {
return getStatusLabel()[$cell];
},
'status' => [
"format" => "integer",
"value" => function ($cell) {
return getStatusLabel()[$cell];
}],
'email' => function ($cell) {
return "<span style='color: aqua'>$cell</span>";
},