Hi,
ich möchte in einem HTML Inhaltselement eine PHP Datei aufrufen: {{file::training-courses-de.php}}
Das klappt aber ich bekomme folgenden Fehler:
Code:
[2018-03-08 18:22:23] request.INFO: Matched route "contao_frontend". {"route":"contao_frontend","route_parameters":{"_token_check":true,"_controller":"Contao\\CoreBundle\\Controller\\FrontendController::indexAction","_scope":"frontend","_locale":null,"alias":"training-kursdetails","_route":"contao_frontend"},"request_uri":"http://dev.intra.de/training-kursdetails?course=ICM-010","method":"HEAD"} []
[2018-03-08 18:22:23] security.INFO: Attempting SimplePreAuthentication. {"key":"frontend","authenticator":"Contao\\CoreBundle\\Security\\ContaoAuthenticator"} []
[2018-03-08 18:22:23] request.INFO: Matched route "contao_frontend". {"route":"contao_frontend","route_parameters":{"_token_check":true,"_controller":"Contao\\CoreBundle\\Controller\\FrontendController::indexAction","_scope":"frontend","_locale":null,"alias":"training-kursdetails","_route":"contao_frontend"},"request_uri":"http://dev.intra.de/training-kursdetails?course=ICM-010","method":"GET"} []
[2018-03-08 18:22:23] security.INFO: Attempting SimplePreAuthentication. {"key":"frontend","authenticator":"Contao\\CoreBundle\\Security\\ContaoAuthenticator"} []
[2018-03-08 18:22:23] app.CRITICAL: An exception occurred. {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Cannot use string offset as an array at /wwwroot.wwwnew/templates/training-courses-de.php:51)"} []
In Zeile 51 steht folgende:
Code:
$list{$count}{'id'}=$row['Id'];
Im ganzen:
Code:
if($result->numRows) {
$rows = $result->fetchAllAssoc();
$count=0;
foreach ($rows as $row) {
$count++;
$list{$count}{'id'}=$row['Id'];
$list{$count}{'name'}=$row['NAME'];
$list{$count}{'start'}=substr($row['START_DT'],8,2).'.'.substr($row['START_DT'],5,2).'.'.substr($row['START_DT'],0,4);
$list{$count}{'end'}=$row['END_DT'];
$list{$count}{'descr'}=$row['DESC_TEXT'];
$list{$count}{'location'}=$row['LOCATION_DESC'];
$list{$count}{'status'}=$row['STATUS_CD'];
$list{$count}{'duration'}=$row['DURATION_DESC'];
$list{$count}{'currency'}=$row['LST_PRI_CURCY_CD'];
$list{$count}{'price'}=$row['LST_PRI_AMT'];
}
$list[0]=$count;
Was mache ich da?
LG & Danke
Lesezeichen