# Controller Routes in Shopware 6.6.0.0-rc3

**URL:** https://forum.shopware.com/t/controller-routes-in-shopware-6-6-0-0-rc3/103029
**Category:** Shopware 6 (German)
**Created:** [19. Februar 2024 um 13:57 UTC](https://forum.shopware.com/t/controller-routes-in-shopware-6-6-0-0-rc3/103029 "2024-02-19T13:57:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Liverson](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@Liverson](https://forum.shopware.com/u/Liverson)
#### Post date: [19. Februar 2024 um 13:57 UTC](https://forum.shopware.com/t/controller-routes-in-shopware-6-6-0-0-rc3/103029/1 "2024-02-19T13:57:23Z")

</div>

Hallo,

bin grad am verzweifeln bei der Aufgabe ein Plugin für 6.6 kompatibel zu machen.  
Dort gibt es einen Admin und einen Storefrontcontroller mit entsprechenden Route Annotations.

Mit der Registrierung der Controller in der routes.xml schmeisst mir der Shop die Fehlermeldung:  
Cannot load resource /var/www/html/custom/plugins/MyPlugin/src/Controller/Administration/MyController.php. Make sure there is a loader supporting the annotation type.  
Storefront-Controller analog …

Im Controller sollte eigentlich alles korrekt sein

1. use Statement für use Symfony\Component\Routing\Annotation\Route;
2. Route-Scope definiert: #[Route(defaults: [‚\_routeScope‘ =\> [‚api‘]])]
3. bei der ControllerAction entsprechende Route definiert: #[Route(path: ‚/api/myvendor/send-foo-bar‘, name: ‚api.action.myvendor.send-foo-bar‘, methods: [‚POST‘])]

Hat jemande eine Idee, wieso das nicht mehr wie unter 6.5 funktioniert, ich finde in der 6.6 Doku keine Info dazu, dass sich bei den Controller Routes was geändert haben soll.

LG Oliver

---

<div class="post-metadata">

### Author: ![Liverson](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@Liverson](https://forum.shopware.com/u/Liverson)
#### Post date: [19. Februar 2024 um 15:00 UTC](https://forum.shopware.com/t/controller-routes-in-shopware-6-6-0-0-rc3/103029/2 "2024-02-19T15:00:36Z")

</div>

so, hab jetzt mal via console ein basic skeleton plugin mit Controller und Routes erstellen lassen.

Auch hier ist es das gleiche, wenn ich das Plugin isntallieren kommt sofort die Meldung  
annot load resource „/var/www/html/custom/plugins/SwagBasicExample/src/Storefront/Controller/ExampleController.php“. Make sure there is a loader supporting the „annotation“ type.

Scheint ein Bug mit der 6.6 zu sein, evtl. kann ja jemand von Shopware was dazu sagen?

---

<div class="post-metadata">

### Author: ![Liverson](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@Liverson](https://forum.shopware.com/u/Liverson)
#### Post date: [19. Februar 2024 um 17:19 UTC](https://forum.shopware.com/t/controller-routes-in-shopware-6-6-0-0-rc3/103029/3 "2024-02-19T17:19:53Z")

</div>

so, jetzt hab ichs endlich rausgefunden.

In Symfony 7 werden die Routes über type „attribute“ registriert statt „annotions“  
**routes.xml:** `<import resource="../../Controller/**/*Controller.php" type="attribute" />`

**Im Controller:**  
vorher: `use Symfony\Component\Routing\Annotation\Route;`  
nachher: `use Symfony\Component\Routing\Attribute\Route;`

Wäre auch schön gewesen, wenn das mal für den jeweiligen Branch kommuniziert gewesen wäre, bevor man sich einen Wolf sucht…  
hier wird unter 6.6 noch die alte Implementierung kommunziert …

> **[Add Custom Controller | Shopware Documentation](https://developer.shopware.com/docs/v6.6rc/guides/plugins/plugins/storefront/add-custom-controller.html)**
>
> Documentation for Shopware developers

---

<div class="post-metadata">

### Author: ![system](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/2/9/29c7587ba660f00e4995d1743162782e5d6d8653.svg) [@system](https://forum.shopware.com/u/system)
#### Post date: [20. März 2024 um 17:20 UTC](https://forum.shopware.com/t/controller-routes-in-shopware-6-6-0-0-rc3/103029/4 "2024-03-20T17:20:13Z")

</div>

Dieses Thema wurde automatisch 30 Tage nach der letzten Antwort geschlossen. Es sind keine neuen Antworten mehr erlaubt.
