1. Go to this page and download the library: Download vkrtecek/table library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vkrtecek / table example snippets
class TestObject
{
private $id;
private $name;
private $age;
private $birthdate;
public function __construct($id, $name, $age, $birthdate = NULL) {
$this->id = $id;
$this->name = $name;
$this->age = $age;
}
public function getId() { return $this->id; }
public function getName() { return $this->name; }
public function getAge() { return $this->age; }
public function getBirthDate() { return $this->birthdate; }
}
$data = [
new TestObject(1, 'John', 38),
new TestObject(2, 'Susane', 35),
new TestObject(3, 'Paul', 13),
new TestObject(4, 'Joe', 25),
new TestObject(5, 'Lucia', 80),
new TestObject(6, 'Štěpán', 29, '1989-03-23'),
];
$table = \Vkrtecek\Table\Table::create($data)
->addColumn('ID of person')->setContent('id')
->addColumn('Name')->setContent('name')
->addColumn('Age')->setContent('age');