Hallo zusammen,
ich bin gerade mit der Erweiterung beschäftigt, und möchte einen Controller hinzufügen, habe mir docus angeguckt: https://docs.contao.org/dev/framework/routing/ und einbisschen angepasst
routes.yaml sieht so aus:
Code:
app.controller:
resource: ../../Controller
type: attribute
ExampleController.php sieht so aus:
Code:
<?php
namespace PewPew\ContaoCompanyEventsBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
#[Route('/example', name: ExampleController::class)]
class ExampleController
{
public function __invoke(Request $request): Response
{
return new Response('works');
}
}
Wenn ich aber vendor/bin/contao-console debug:router "PewPew\ContaoCompanyEventsBundle\Controller\Examp leController" aufrufe - bekomme ich folgende Fehlermeldung:
The route "PewPew\ContaoCompanyEventsBundle\Controller\Examp leController" does not exist.
Beim vendor/bin/contao-console debug:router - ist Route auch nicht drin
Beim php bin/console config:dump-reference - ist Bundle drin
composer install / update / dump-autoload, php bin/console cache:clear, php bin/console cache:warmup Befehle bringen auch nichts
Habe ich was verpasst? Soll ich noch was anpassen was in Docus nicht steht?
P.S: Dieses Thema ist sehr ähnlich aus: https://community.contao.org/de/show...does-not-exist