-
-
Notifications
You must be signed in to change notification settings - Fork 498
Add doc about debug:router
#1449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GromNaN
wants to merge
2
commits into
symfony:main
Choose a base branch
from
GromNaN:routes-cli-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for the PR 😍 How to test these changes in your application
Diff between recipe versionsIn order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. symfony/routing3.3 vs 4.0diff --git a/symfony/routing/3.3/config/routes.yaml b/symfony/routing/4.0/config/routes.yaml
index 59d1945f..c3283aa2 100644
--- a/symfony/routing/3.3/config/routes.yaml
+++ b/symfony/routing/4.0/config/routes.yaml
@@ -1,6 +1,3 @@
-# This file is the entry point to configure your own HTTP routes.
-# Files in the routes/ subdirectory configure the routes for your dependencies.
-
#index:
# path: /
-# defaults: { _controller: 'App\Controller\DefaultController::index' }
+# controller: App\Controller\DefaultController::index 4.0 vs 4.2diff --git a/symfony/routing/4.2/config/packages/routing.yaml b/symfony/routing/4.2/config/packages/routing.yaml
new file mode 100644
index 00000000..7e977620
--- /dev/null
+++ b/symfony/routing/4.2/config/packages/routing.yaml
@@ -0,0 +1,3 @@
+framework:
+ router:
+ utf8: true 4.2 vs 5.1diff --git a/symfony/routing/4.2/config/packages/routing.yaml b/symfony/routing/5.1/config/packages/routing.yaml
index 7e977620..b45c1cec 100644
--- a/symfony/routing/4.2/config/packages/routing.yaml
+++ b/symfony/routing/5.1/config/packages/routing.yaml
@@ -1,3 +1,7 @@
framework:
router:
utf8: true
+
+ # Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
+ # See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
+ #default_uri: http://localhost 5.1 vs 5.3diff --git a/symfony/routing/5.1/config/packages/prod/routing.yaml b/symfony/routing/5.1/config/packages/prod/routing.yaml
deleted file mode 100644
index b3e6a0af..00000000
--- a/symfony/routing/5.1/config/packages/prod/routing.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-framework:
- router:
- strict_requirements: null
diff --git a/symfony/routing/5.1/config/packages/routing.yaml b/symfony/routing/5.3/config/packages/routing.yaml
index b45c1cec..4b766ce5 100644
--- a/symfony/routing/5.1/config/packages/routing.yaml
+++ b/symfony/routing/5.3/config/packages/routing.yaml
@@ -5,3 +5,8 @@ framework:
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost
+
+when@prod:
+ framework:
+ router:
+ strict_requirements: null
diff --git a/symfony/routing/5.1/manifest.json b/symfony/routing/5.3/manifest.json
index c0c66b64..a3f340ed 100644
--- a/symfony/routing/5.1/manifest.json
+++ b/symfony/routing/5.3/manifest.json
@@ -2,5 +2,8 @@
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/"
},
- "aliases": ["router"]
+ "aliases": ["router"],
+ "conflict": {
+ "symfony/framework-bundle": "<5.3"
+ }
} 5.3 vs 6.0diff --git a/symfony/routing/5.3/config/routes.yaml b/symfony/routing/6.0/config/routes.yaml
index c3283aa2..5b102f60 100644
--- a/symfony/routing/5.3/config/routes.yaml
+++ b/symfony/routing/6.0/config/routes.yaml
@@ -1,3 +1,7 @@
-#index:
-# path: /
-# controller: App\Controller\DefaultController::index
+controllers:
+ resource: ../src/Controller/
+ type: annotation
+
+kernel:
+ resource: ../src/Kernel.php
+ type: annotation 6.0 vs 6.1diff --git a/symfony/routing/6.0/config/routes.yaml b/symfony/routing/6.1/config/routes.yaml
index 5b102f60..9286e818 100644
--- a/symfony/routing/6.0/config/routes.yaml
+++ b/symfony/routing/6.1/config/routes.yaml
@@ -1,7 +1,3 @@
controllers:
resource: ../src/Controller/
- type: annotation
-
-kernel:
- resource: ../src/Kernel.php
- type: annotation
+ type: attribute 6.1 vs 6.2diff --git a/symfony/routing/6.1/config/routes.yaml b/symfony/routing/6.2/config/routes.yaml
index 9286e818..41ef8140 100644
--- a/symfony/routing/6.1/config/routes.yaml
+++ b/symfony/routing/6.2/config/routes.yaml
@@ -1,3 +1,5 @@
controllers:
- resource: ../src/Controller/
+ resource:
+ path: ../src/Controller/
+ namespace: App\Controller
type: attribute
diff --git a/symfony/routing/6.1/manifest.json b/symfony/routing/6.2/manifest.json
index a3f340ed..db102603 100644
--- a/symfony/routing/6.1/manifest.json
+++ b/symfony/routing/6.2/manifest.json
@@ -4,6 +4,6 @@
},
"aliases": ["router"],
"conflict": {
- "symfony/framework-bundle": "<5.3"
+ "symfony/framework-bundle": "<6.2"
}
} 6.2 vs 7.0diff --git a/symfony/routing/6.2/config/packages/routing.yaml b/symfony/routing/7.0/config/packages/routing.yaml
index 4b766ce5..8166181c 100644
--- a/symfony/routing/6.2/config/packages/routing.yaml
+++ b/symfony/routing/7.0/config/packages/routing.yaml
@@ -1,7 +1,5 @@
framework:
router:
- utf8: true
-
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost
diff --git a/symfony/routing/6.2/manifest.json b/symfony/routing/7.0/manifest.json
index db102603..fd4536e6 100644
--- a/symfony/routing/6.2/manifest.json
+++ b/symfony/routing/7.0/manifest.json
@@ -4,6 +4,6 @@
},
"aliases": ["router"],
"conflict": {
- "symfony/framework-bundle": "<6.2"
+ "symfony/framework-bundle": "<7.0"
}
} 7.0 vs 7.4diff --git a/symfony/routing/7.0/config/routes.yaml b/symfony/routing/7.4/config/routes.yaml
index 41ef8140..8f00a057 100644
--- a/symfony/routing/7.0/config/routes.yaml
+++ b/symfony/routing/7.4/config/routes.yaml
@@ -1,5 +1,8 @@
+# $schema: ../vendor/symfony/routing/Loader/schema/routing.schema.json
+
+# To list all registered routes, run the following command:
+# bin/console debug:router
+
controllers:
- resource:
- path: ../src/Controller/
- namespace: App\Controller
- type: attribute
+ resource: attributes
+ type: tagged_services |
fabpot
requested changes
Aug 23, 2025
Co-authored-by: Fabien Potencier <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
One concern I have heard frequently regarding the use of attributes for routes is that it would be challenging to know the list of all routes in an application (unlike a dedicated routing file).
By adding these two lines of documentation, we are guiding developers toward the solution.