tables/examples/view.php

24 lines
522 B
PHP

<?php
require_once "../vendor/autoload.php";
use Itguild\Tables\ViewJsonTable;
$json = file_get_contents('view.json');
$table = new ViewJsonTable($json);
$table->addRow("Имя", function (){
return "Kirill";
}, ['after' => 'username']);
//$table->rows([
$table->rows([
'username' => function ($cell) {
return "<span style='color: aqua'>$cell</span>";
},
'email' => function ($cell) {
return "<span style='color: firebrick'>$cell</span>";
}
]);
$table->create();
$table->render();