tables/examples/view.php

24 lines
522 B
PHP
Raw Permalink Normal View History

2024-07-23 15:17:16 +03:00
<?php
require_once "../vendor/autoload.php";
use Itguild\Tables\ViewJsonTable;
$json = file_get_contents('view.json');
$table = new ViewJsonTable($json);
2024-11-28 11:57:17 +03:00
$table->addRow("Имя", function (){
return "Kirill";
}, ['after' => 'username']);
2024-08-02 15:40:13 +03:00
//$table->rows([
2024-08-06 12:10:26 +03:00
$table->rows([
'username' => function ($cell) {
return "<span style='color: aqua'>$cell</span>";
2024-08-02 13:26:32 +03:00
},
2024-08-06 12:10:26 +03:00
'email' => function ($cell) {
return "<span style='color: firebrick'>$cell</span>";
2024-08-02 13:26:32 +03:00
}
]);
2024-07-23 15:17:16 +03:00
$table->create();
$table->render();