From 2d2269f1bd4d3950c5ea0300f3f91e9877105692 Mon Sep 17 00:00:00 2001 From: mamazu <14860264+mamazu@users.noreply.github.com> Date: Sat, 23 Aug 2025 11:32:45 +0200 Subject: [PATCH] Documenting changes in the debug:router output --- page_creation.rst | 10 +++++----- routing.rst | 41 +++++++++++++++++++++++++++++++---------- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/page_creation.rst b/page_creation.rst index 0e2fd78e180..d7833b84bee 100644 --- a/page_creation.rst +++ b/page_creation.rst @@ -125,11 +125,11 @@ You should see your ``app_lucky_number`` route in the list: .. code-block:: terminal - ---------------- ------- ------- ----- -------------- - Name Method Scheme Host Path - ---------------- ------- ------- ----- -------------- - app_lucky_number ANY ANY ANY /lucky/number - ---------------- ------- ------- ----- -------------- + ---------------- ------- -------------- + Name Method Path + ---------------- ------- -------------- + app_lucky_number ANY /lucky/number + ---------------- ------- -------------- You will also see debugging routes besides ``app_lucky_number`` -- more on the debugging routes in the next section. diff --git a/routing.rst b/routing.rst index 9e83964bd2b..1d1147fa6b1 100644 --- a/routing.rst +++ b/routing.rst @@ -487,20 +487,23 @@ evaluates them: $ php bin/console debug:router - ---------------- ------- ------- ----- -------------------------------------------- - Name Method Scheme Host Path - ---------------- ------- ------- ----- -------------------------------------------- - homepage ANY ANY ANY / - contact GET ANY ANY /contact - contact_process POST ANY ANY /contact - article_show ANY ANY ANY /articles/{_locale}/{year}/{title}.{_format} - blog ANY ANY ANY /blog/{page} - blog_show ANY ANY ANY /blog/{slug} - ---------------- ------- ------- ----- -------------------------------------------- + ---------------- ------- -------------------------------------------- + Name Method Path + ---------------- ------- -------------------------------------------- + homepage ANY / + contact GET /contact + contact_process POST /contact + article_show ANY /articles/{_locale}/{year}/{title}.{_format} + blog ANY /blog/{page} + blog_show ANY /blog/{slug} + ---------------- ------- -------------------------------------------- # pass this option to also display all the defined route aliases $ php bin/console debug:router --show-aliases + # pass this option to also display the associated controllers with the routes + $ php bin/console debug:router --show-controllers + # pass this option to only display routes that match the given HTTP method # (you can use the special value ANY to see routes that match any method) $ php bin/console debug:router --method=GET @@ -510,6 +513,24 @@ evaluates them: The ``--method`` option was introduced in Symfony 7.3. +.. versionadded:: 7.4 + + For sites that don't have routes with schemes or hosts defined those columns are + hidden. They will be displayed if some routes configure the schema or host properties + of the route + + .. code-block:: terminal + + $ php bin/console debug:router + + ------------ ------- ------- --------- --------- + Name Method Scheme Host Path + ------------ ------- ------- --------- --------- + homepage ANY http ANY /homapage + contact GET https ANY /contact + contact_post POST ANY localhost /contact + ------------ ------- ------- --------- --------- + Pass the name (or part of the name) of some route to this argument to print the route details: