PHP code example of liquidlight / module-data-listing
1. Go to this page and download the library: Download liquidlight/module-data-listing 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/ */
liquidlight / module-data-listing example snippets
protected string $templateName = 'MyRecords/Index';
$this->pageRenderer->addCssFile('EXT:my_extension/Resources/Public/Css/MyRecords.css');
return [
'dependencies' => [
'core',
'backend',
'module_data_listing',
],
'imports' => [
'@my-vendor/my-extension/' => 'EXT:my_extension/Resources/Public/JavaScript/',
],
];
return [
'datalisting' => [
'access' => 'user',
'path' => '/module/datalisting',
'iconIdentifier' => 'modulegroup-datalisting',
'labels' => 'LLL:EXT:module_data_listing/Resources/Private/Language/locallang_mod_datalisting.xlf',
'position' => [
'after' => 'file',
],
],
'datalisting_myrecords' => [
'parent' => 'datalisting',
'access' => 'user',
'iconIdentifier' => 'module-listing-report',
'labels' => 'LLL:EXT:my_extension/Resources/Private/Language/locallang_mod_myrecords.xlf',
'extensionName' => 'MyExtension',
'controllerActions' => [
\MyVendor\MyExtension\Controller\MyRecordsController::class => [
'index',
],
],
],
];
use TYPO3\CMS\Backend\Attribute\AsController;
#[AsController]
class MyRecordsController extends DatatableController
diff
- public function indexAction(): void
+ public function indexAction(): ResponseInterface
{
- parent::indexAction();
- $this->view->assignMultiple([
- 'groups' => $this->getUsergroups(),
- ]);
+ $this->getModuleTemplate()->assign('groups', $this->getUsergroups());
+
+ return parent::indexAction();
}