<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
heimrichhannot / contao-dc-multilingual-utils-bundle example snippets
/**
* @Hook("loadDataContainer")
*/
class LoadDataContainerListener
{
private DcMultilingualUtil $multilingualUtil;
public function __invoke(string $table): void
{
if ('tl_content' === $table) {
$this->multilingualUtil->addDcMultilingualSupport(
$table, ['de', 'en', 'pl'], 'de', [ 'text', 'rsce_data' ]
);
}
}
}
/**
* @Hook("loadDataContainer")
*/
class LoadDataContainerListener
{
private DcMultilingualUtil $multilingualUtil;
public function __invoke(string $table): void
{
if ('tl_content' === $table) {
$this->multilingualUtil->addDcMultilingualSupport(
$table, // Table name
['de', 'en', 'pl'], // Supported languages
'de', // Fallback language
[ // the translatable fields
'text', // add fields here...
'rsce_data' // add this if you have rocksolid custom elements (tl_content only)
],
[ // options
'langColumnName', // the language field in the dca's records (you have a record for every language and this column holds which one it is)
'langPid', // this field holds the parent record of every translated record
]
);
break;
}
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.