PHP code example of heimrichhannot / contao-tinymce-bundle
1. Go to this page and download the library: Download heimrichhannot/contao-tinymce-bundle 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/ */
heimrichhannot / contao-tinymce-bundle example snippets
class CustomDataContainer
{
private RequestStack $requestStack;
private ScopeMatcher $scopeMatcher;
public function onLoadCallback(DataContainer $dc = null): void
{
if ($this->requestStack->getCurrentRequest() && $this->scopeMatcher->isFrontendRequest($this->requestStack->getCurrentRequest())) {
$GLOBALS['TL_DCA']['tl_custom']['fields']['text']['eval']['rte'] = 'tinyMCE';
}
}
}