marcosimbuerger / contao-data-container-extension
Extends the Contao data container.
Installs: 148
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:contao-bundle
Requires
- php: ^8.1
- contao/core-bundle: ^4.13
Conflicts
- contao/core: *
- contao/manager-plugin: <2.0 || >=3.0
This package is auto-updated.
Last update: 2025-04-29 01:10:38 UTC
README
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 }; }