Bin grad bei meine erste Erweiterung für Contao 5.3 fertig zu machen... hat sich da schon wieder was geändert zu der 4.13?
PHP-Code:
namespace WEBROXX\TESTManager\Controller\Frontend;
use Contao\CoreBundle\Controller\FrontendModule\AbstractFrontendModuleController;
use Contao\CoreBundle\ServiceAnnotation\FrontendModule;
use Contao\CoreBundle\Exception\PageNotFoundException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Contao\ModuleModel;
use Contao\PageModel;
use Contao\Template;
use Contao\System;
use Contao\StringUtil;
use Contao\Controller;
/**
* @FrontendModule("default_stats", category="test-manager")
*/
class DefaultStatsController extends AbstractFrontendModuleController {
protected function getResponse(Template $template, ModuleModel $model, Request $request) : ? Response {
$stats = "test";
return $this->render('@Contao/default_stats.html.twig', [
'stats' => $stats,
'mod_class' => 'mod_default_stats'
]);
}
}
Fehler im Contao-manager
Code:
PHP Fatal error: Declaration of WEBROXX\TESTManager\Controller\Frontend\DefaultStatsController::getResponse(Contao\CoreBundle\Twig\FragmentTemplate $template, Contao\ModuleModel $model, Symfony\Component\HttpFoundation\Request $request): ?Symfony\Component\HttpFoundation\Response must be compatible with Contao\CoreBundle\Controller\FrontendModule\AbstractFrontendModuleController::getResponse(Contao\CoreBundle\Twig\FragmentTemplate $template, Contao\ModuleModel $model, Symfony\Component\HttpFoundation\Request $request): Symfony\Component\HttpFoundation\Response in /www/htdocs/w018cf31/domain/vendor/webroxx/contao-test-bundle/src/Controller/Frontend/DefaultStatsController.php on line 29