PHP code example of xima / xima-typo3-recordlist

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;

class UserController extends AbstractBackendController
{
    public function getTableName(): string
    {
        return 'fe_users';
    }

    public function getRecordPid(): int
    {
        return $this->site->getConfiguration()['userPid'] ?? 0;
    }
}


// EXT:my_extension/Configuration/Backend/Modules.php

use Xima\XimaTypo3Recordlist\Controller\ExamplePagesController;

return [
    'example_pages' => [
        'parent' => 'web',
        'position' => ['after' => 'list'],
        'access' => 'user',
        'iconIdentifier' => 'module-cshmanual',
        'workspaces' => '*',
        'labels' => 'LLL:EXT:xima_typo3_recordlist/Resources/Private/Language/locallang_pages_module.xlf',
        'extensionName' => 'MyExtension',
        'controllerActions' => [
            ExamplePagesController::class => [
                'processRequest',
            ],
        ],
        'inheritNavigationComponentFromMainModule' => false,
    ],
];




class UserController extends AbstractBackendController
{
    protected const TEMPLATE_NAME = 'Custom';
}

class UserController extends AbstractBackendController
{
    public function modifyRecord(array &$record): void
    {
        $record['fullName'] = $record['first_name'] . ' ' . $record['last_name'];
    }
}

class UserController extends AbstractBackendController
{
    public function modifyQueryBuilder(): void
    {
        if (isset($body['register_date']) && $body['register_date']) {
            $registerDate = new DateTime($body['register_date']);
            $this->additionalConstraints[] = $this->queryBuilder->expr()->gte('register_date', $registerDate->getTimestamp());
        }
    }
}



class NewsController extends AbstractBackendController
{
    public function modifyTableConfiguration(): void
    {
        $this->tableConfiguration['columns']['fal_media']['defaultPosition'] = 2;
        $this->tableConfiguration['columns']['author']['defaultPosition'] = 3;
        $this->tableConfiguration['columns']['sitemap_changefreq']['defaultPosition'] = 4;
        $this->tableConfiguration['columns']['sys_language_uid']['defaultPosition'] = 5;
        $this->tableConfiguration['columns']['workspace-status']['defaultPosition'] = 6;
    }
}



class UserController extends AbstractBackendController
{
    public function modifyTableConfiguration(): void
    {
        // make title field inline editiable
        $this->tableConfiguration['columns']['title']['partial'] = 'TextInlineEdit';
    }
}