1. Go to this page and download the library: Download italix/datasets 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/ */
italix / datasets example snippets
use Italix\DataSets\DataSet;
use Italix\DataSets\Drivers\Tabulator\TabulatorDriver;
// Create a dataset from any TableMeta source (e.g. from italix/orm)
$ds = new DataSet($usersTable);
// Select and configure columns
$ds->columns(['name', 'email', 'role', 'created_at']);
$ds->column('name')->sortable(true)->searchable(true)->width('200px');
$ds->column('email')->sortable(true)->searchable(true);
$ds->column('role')->sortable(true)->horizontal_align('center');
$ds->column('created_at')->sortable(true)->formatter('datetime');
// Server-side data loading
$ds->ajax_url('/api/users')
->per_page(25)
->default_sort('created_at', 'desc');
// Render with Tabulator
$driver = new TabulatorDriver();
$script = $driver->render_script($ds, '#users-table', 'usersTable');
use function Italix\DataSets\dataset;
use function Italix\DataSets\data_tree;
$ds = dataset($usersTable)->columns(['name', 'email'])->ajax_url('/api/users');
$tree = data_tree($categoriesTable)->ajax_url('/api/categories');
use function Italix\Orm\Schema\{mysql_table, integer, varchar, timestamp};
$users = mysql_table('users', [
'id' => integer()->primary_key()->auto_increment(),
'name' => varchar(100)->not_null(),
'email' => varchar(255)->not_null(),
'created_at' => timestamp()->default_value('CURRENT_TIMESTAMP'),
]);
// Pass directly to DataSet — no adapters needed
$ds = new DataSet($users);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.