1. Go to this page and download the library: Download xima/xima-typo3-recordlist 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/ */
xima / xima-typo3-recordlist example snippets
// EXT:my_extension/Classes/Controller/UserController.php
namespace Vendor\MyExtension\Controller\Backend;
use Xima\XimaTypo3Recordlist\Controller\AbstractBackendController;
use Xima\XimaTypo3Recordlist\Dto\RecordSource;
class UserController extends AbstractBackendController
{
public function getTableNames(): array
{
return ['fe_users'];
}
protected function getRecordSources(): array
{
return [new RecordSource(pid: 7,
public function getTableNames(): array
{
return ['be_users', 'be_groups', 'sys_filemounts'];
}
use Xima\XimaTypo3Recordlist\Controller\AbstractBackendController;
use Xima\XimaTypo3Recordlist\Dto\RecordSource;
class NewsController extends AbstractBackendController
{
protected function getRecordSources(): array
{
return [
new RecordSource(pid: 15,
class UserController extends AbstractBackendController
{
protected function modifyRecord(array &$record): void
{
// Add computed field
$record['fullName'] = $record['first_name'] . ' ' . $record['last_name'];
// Format date
$record['formatted_date'] = date('Y-m-d', $record['crdate']);
}
}
class NewsController extends AbstractBackendController
{
protected function modifyTableConfiguration(): void
{
// Show categories filter even when the categories column is hidden
$this->tableConfiguration['your-table-name']['columns']['categories']['filterVisible'] = true;
}
}
class UserController extends AbstractBackendController
{
protected function modifyQueryBuilder(): void
{
$body = $this->request->getParsedBody();
// Add custom date filter
if (!empty($body['register_date'])) {
$registerDate = new \DateTime($body['register_date']);
$this->additionalConstraints[] = $this->queryBuilder->expr()->gte(
'register_date',
$registerDate->getTimestamp()
);
}
// Add custom status filter
if (!empty($body['status'])) {
$this->additionalConstraints[] = $this->queryBuilder->expr()->eq(
'status',
$this->queryBuilder->createNamedParameter($body['status'])
);
}
}
}