Symfony2: Routing-Priorität
Posted: 13 Jan 2025, 13:34
Gibt es überhaupt eine Möglichkeit, Routen in Symfony2 zu priorisieren?
Ich verwende Annotation, es sieht so aus
Controller
Config
Ziel
Wie kann ich erzwingen, dass TestController zuerst getestet wird?
Vielen Dank
Ich verwende Annotation, es sieht so aus
Controller
Code: Select all
//TestController.php
/**
* @Route("/test")
*/
class TestController extends Controller
{
/**
* @Route("/a", name="test_a")
*/
.....
//DummyController.php
/**
* @Route("/")
*/
class DummyController extends Controller
{
/**
* @Route("/{varA}/{varB}", name="dummy_one")
*/
.....
Code: Select all
//routing.yml
acme_bundle:
resource: "@Acme/Controller"
type: annotation
Code: Select all
URL , Actual , Goal
/test/a , DummyController , TestController //Wrong
/test/b , DummyController , DummyController //Good
Vielen Dank