PHP code example of dimaxz / activetable
1. Go to this page and download the library: Download dimaxz/activetable 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/ */
dimaxz / activetable example snippets
//создаем объект таблицы, передаем репозитрий реализующий интерфейс Repo/CrudRepository из пакета dimaxz/repository
$table = new DataTableSimple(new UserRepository,"users");
$table->setSearchCriteria( new UserCriteria() );
//колонки
$table->addColumn( new ColumnTable("id","№"));
$table->addColumn( new ColumnTable("name","Наименование"));
$table->addColumn( new ColumnTable("email","E-mail"));
//поля
$table->addField( new FormInput("id"));
$table->addField( new FormInput("name"));
$table->addField( new FormInput("email"));
//вывод в html
dump($table->render());