Der Versuch hier:
Code:
<?php
namespace Contao;
class MyClass extends \Contao
{
public function myPrepareFormData($arrSubmitted,$arrLabels,$arrFields,$objForm)
{
$this->import('Database');
}
}
... führt zu folgendem Fehler:
Code:
[2019-05-23 10:09:31] request.INFO: Matched route "contao_frontend". {"route":"contao_frontend","route_parameters":{"_token_check":true,"_controller":"Contao\\CoreBundle\\Controller\\FrontendController::indexAction","_scope":"frontend","alias":"assistent/template1-kopie","_route":"contao_frontend"},"request_uri":"http://huebscher/assistent/template1-kopie?s1=a&s2=t","method":"POST"} []
[2019-05-23 10:09:31] security.INFO: Attempting SimplePreAuthentication. {"key":"frontend","authenticator":"Contao\\CoreBundle\\Security\\ContaoAuthenticator"} []
[2019-05-23 10:09:31] app.CRITICAL: An exception occurred. {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\ClassNotFoundException(code: 0): Attempted to load class \"Contao\" from the global namespace.\nDid you forget a \"use\" statement? at /Users/lissabon/Dropbox/Themes/huebscher/system/modules/assistant/modules/HuebscherFormHooks.php:10)"} []