Page 1 of 1

Symfony2: Routing-Priorität

Posted: 13 Jan 2025, 13:34
by Guest
Gibt es überhaupt eine Möglichkeit, Routen in Symfony2 zu priorisieren?

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")
*/
.....
Config

Code: Select all

//routing.yml

acme_bundle:
resource: "@Acme/Controller"
type:     annotation
Ziel

Code: Select all

URL      , Actual              , Goal
/test/a  , DummyController     , TestController  //Wrong
/test/b  , DummyController     , DummyController //Good
Wie kann ich erzwingen, dass TestController zuerst getestet wird?

Vielen Dank