Open ERP-Academia opened 3 years ago
Php8 does not accept $app->router->post('/contact', [SiteController::class, 'handleContact']);
$app->router->post('/contact', [SiteController::class, 'handleContact']);
It accepts $app->router->post('/contact', [new SiteController(), 'handleContact']);
$app->router->post('/contact', [new SiteController(), 'handleContact']);
The problem occurs if you are building the framework following the steps in the video. It is solved later in Router->resolve()
Router->resolve()
The Problem is resolved later, here. You can specify like this $app->router->post('/contact', [SiteController::class, 'handleContact']); and it will create an instance behind
Php8 does not accept
$app->router->post('/contact', [SiteController::class, 'handleContact']);
It accepts
$app->router->post('/contact', [new SiteController(), 'handleContact']);
The problem occurs if you are building the framework following the steps in the video. It is solved later in
Router->resolve()