du hast recht der ursprüngliche code ist:
PHP-Code:
<script src="<?php
$objCombiner = new \Contao\Combiner();
$objCombiner->add('files/theme/uikit-3.15.24/js/uikit.min.js');
$objCombiner->add('files/theme/uikit-3.15.24/js/uikit-icons.min.js');
//$objCombiner->add('files/theme/cookieconsent-2.8.8/dist/cookieconsent.js');
//$objCombiner->add('files/theme/js/cookieconsent288-init-essentiell.js');
//$objCombiner->add('files/theme/js/cookieconsent288-init-gtag.js');
$strFile = $objCombiner->getCombinedFile();
global $objPage;
if( empty($GLOBALS['TL_DEBUG']) && empty($objPage->staticPlugins) )
{
$objFile = new \Contao\File( $strFile.'.minified.js' );
if( $objFile->exists() === false && class_exists('\MatthiasMullie\Minify\JS') )
{
$objMinify = new \MatthiasMullie\Minify\JS();
$objMinify->add( \file_get_contents(TL_ROOT.'/'.$strFile) );
$objFile->write( $objMinify->minify() );
$objFile->renameTo( $strFile.'.minified.js' );
$objFile->close();
$strFile .= '.minified.js';
}
else
{
$strFile .= '.minified.js';
}
}
echo $strFile; ?>"></script>
der fehler ist:
[2023-07-06T12:03:34.696902+02:00] request.INFO: Matched route "tl_page.2". {"route":"tl_page.2","route_parameters":{"_token_c heck":true,"_controller":"Contao\\FrontendIndex::r enderPage","_scope":"frontend","_locale":"de","_fo rmat":"html","_canonical_route":"tl_page.2","param eters":"","pageModel":{"Contao\\PageModel":[]},"_route":"tl_page.2","_route_object":{"Contao\\C oreBundle\\Routing\\Page\\PageRoute":[]}},"request_uri":"http://uikit3.muenchen-webdesign.eu/home","method":"GET"} []
[2023-07-06T12:03:35.080630+02:00] request.CRITICAL: Uncaught PHP Exception Error: "Undefined constant "TL_ROOT"" at /html/contaouikit3/templates/uikittheme/fe_page.html5 line 158 {"exception":"[object] (Error(code: 0): Undefined constant "TL_ROOT" at /html/contaouikit3/templates/uikittheme/fe_page.html5:158)"} []
[2023-07-06T12:03:35.169314+02:00] messenger.INFO: Sending message Contao\CoreBundle\Messenger\Message\SearchIndexMes sage with contao_prio_low sender using Contao\CoreBundle\Messenger\Transport\AutoFallback Transport {"class":"Contao\\CoreBundle\\Messenger\\Message\\ SearchIndexMessage","alias":"contao_prio_low","sen der":"Contao\\CoreBundle\\Messenger\\Transport\\Au toFallbackTransport"} []
[2023-07-06T12:03:35.169684+02:00] messenger.INFO: Received message Contao\CoreBundle\Messenger\Message\SearchIndexMes sage {"class":"Contao\\CoreBundle\\Messenger\\Message\\ SearchIndexMessage"} []
[2023-07-06T12:03:35.176328+02:00] messenger.INFO: Message Contao\CoreBundle\Messenger\Message\SearchIndexMes sage handled by Contao\CoreBundle\Messenger\MessageHandler\SearchI ndexMessageHandler::__invoke {"class":"Contao\\CoreBundle\\Messenger\\Message\\ SearchIndexMessage","handler":"Contao\\CoreBundle\ \Messenger\\MessageHandler\\SearchIndexMessageHand ler::__invoke"} []
Lesezeichen