Wollte meine Erweiterung gerade unter 4.13 Probieren, leider macht da ein Ajax-Request Probleme....
Fehler:
Code:
Too few arguments to function WEBROXX\FansiteManagerCore\Controller\Ajax\AjaxVideoController::__construct(), 0 passed in /www/htdocs/domain/var/cache/dev/Container1GWLLWd/getAjaxVideoControllerService.php on line 22 and exactly 1 expected
AjaxVideoController.php
PHP-Code:
namespace WEBROXX\FansiteManagerCore\Controller\Ajax;
use Doctrine\DBAL\Connection;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Terminal42\ServiceAnnotationBundle\Annotation\ServiceTag;
use WEBROXX\FansiteManagerCore\Models\FsMusicDiscographieVideosModel;
/**
* @Route("/video/{id}", name=AjaxVideoController::class)
* @ServiceTag("controller.service_arguments")
*/
class AjaxVideoController
{
private $db;
public function __construct(Connection $db)
{
$this->db = $db;
}
public function __invoke(Request $request): Response
{
$objVideo = FsMusicDiscographieVideosModel::findOneBy('id', $id);
...
services.yml
Code:
services:
_defaults:
autoconfigure: true
WEBROXX\FansiteManagerCore\Controller\Ajax\AjaxVideoController: ~
Weitere Fragen:
wird es in Contao 5 wieder oder nochmal anders und kann man schon für Contao 5 vorsorgen oder irgendwie testen?
Lesezeichen