Backend route - $GLOBALS leer
Hallo,
ich habe eine Backend Route erstellt und will dort im Controller folgenden Code aufrufen:
PHP-Code:
$objTable = new \DC_Table( $strTable );
$strContent = $objTable->showAll();
Bekomme aber den Fehler:
Code:
User Error: Could not load the data container configuration
Schaue ich mir $GLOBALS an ist dieser leer.
Contao: 4.6.12
routing.yml
Code:
contao_backend_demo:
path: /contao/demo
defaults:
_scope: backend
_token_check: true
_controller: BUNDLENAME:Backend:demo
BackendController.php
PHP-Code:
public function demoAction()
{
$this->get('contao.framework')->initialize(); // HIER IST ES ABER EGAL OB DIESE ZEILE VORHANDEN IST ODER NICHT!!
$strTable = 'tl_bundle_demo';
$objTable = new \DC_Table( $strTable );
$strContent = $objTable->showAll();
$arrConfig = ['content'=>$strContent];
return new Response( $this->get('twig')->render('@BUNDLENAME/Backend/demo.html.twig', $arrConfig) );
}
Kann mir jemand helfen?
Gibt es eigentlich eine Lösung mit den neuen Routen um eine Tabelle direkt aufzurufen?
LG pressi