<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
heimrichhannot / contao-be_explanation-bundle example snippets
use AppBundle\EventListener\Dca\TableListener;
$GLOBALS['TL_DCA']['tl_table']['fields']['myExplanation'] = [
'inputType' => 'explanation',
'eval' => [
'text' => &$GLOBALS['TL_LANG']['tl_table']['explanation']['myExplanation'], // this is a string, not an array
'text_callback' => [TableListener::class, 'onTextCallback'], // a callback to dynamical generate text. Can also be a callable.
'class' => 'tl_info', // all contao message css classes are possible
'tl_class' => 'w50 long',
'collapsible' => true // If text is to long, if will be collapsed
]
];
public function textCallback(array $attributes): string {
$dc = $attributes["dataContainer"];
$text = $attributes["text"];
return "My new text";
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.