Skip to content

9teufel/contao-data-container-extension

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Contao Data Container Extension

Provides functionality to extend Contao's data container.

Install

composer require marcosimbuerger/contao-data-container-extension

Usage

Data container action method extension

Add TableExtension as data container and add a custom callback to your DCA,

$GLOBALS['TL_DCA']['tl_my_module'] = array
(
	// Config
	'config' => array
	(
		'dataContainer' => 'TableExtension',
		'onload_callback' => array
		(
			array('tl_my_module', 'myOnLoadMethod'),
        ),
        // ...
    ),
    // ...
);
  
   

or replace/extend an existing DCA.

$GLOBALS['TL_DCA']['tl_iso_product_collection']['config']['dataContainer'] = 'TableExtension';
$GLOBALS['TL_DCA']['tl_iso_product_collection']['config']['onload_callback'][] = array('tl_my_module, 'myOnLoadMethod');

Add your custom method (e.g. myDcMethod) to the data container.

// tl_my_module.php

public function myOnLoadMethod(DC_Table $dataContainer): void {
    $dataContainer->myDcMethod = function() {
        // do something
    };
}

About

Extends the Contao data container.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%