tables/examples/simple.php
2024-07-31 17:11:29 +03:00

22 lines
589 B
PHP

<?php
require_once "../vendor/autoload.php";
use Itguild\Tables\ListJsonTable;
$json = file_get_contents('simple.json');
$table = new ListJsonTable($json);
$table->setBeforePrintCell(function ($key, $data) {
return $key == "email" ? "<span style='color: aqua'>$data</span>" : $data;
});
$table->afterPrint(function ($meta) {
return "<div>After Print</div>";
});
$table->addColumn("Колонка 33", "k33", function ($id){
return "my ID: " . $id;
});
$table->addColumn("Колонка 34", "k34", function ($id){
return "some34";
});
$table->create();
$table->render();