Skip to content

Commit 8cf0c85

Browse files
asandjivyhiddewie
authored andcommitted
Update controllers.rst
Added useful debug commands in the debug documentation Merged two commands to shorten the file Fixed bash -> terminal code blocks Updated the command examples to be a list instead pieces of text with large terminal graphics Revert accidental commit
1 parent 952deaf commit 8cf0c85

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

best_practices/controllers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ it more difficult to know which template is being rendered. It also makes
8585
it less obvious to beginners that a controller should always return a Response
8686
object (unless you're using a view layer).
8787

88-
What does the Controller look like
89-
----------------------------------
88+
How the Controller Looks
89+
------------------------
9090

91-
Considering all this, here is an example of what the controller should look like
91+
Considering all this, here is an example of how the controller should look
9292
for the homepage of our app:
9393

9494
.. code-block:: php

debug/debugging.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,29 @@ locations. To avoid problems, you can either tell your IDE to ignore the PHP
5959
cache files, or you can change the extension used by Symfony for these files::
6060

6161
$kernel->loadClassCache('classes', '.php.cache');
62+
63+
Useful debugging commands
64+
-------------------------
65+
66+
When developing a large application, it can be hard to keep track of all the
67+
different services, routes and translations. Luckily, Symfony has some commands
68+
that can help you visualize and find the information.
69+
70+
``debug:container``
71+
Displays about the contents of the Symfony container for all public
72+
services. To find only those matching a name, append the name as an argument.
73+
74+
``debug:config``
75+
Shows all configured bundles, their class and their alias.
76+
77+
``debug:router``
78+
Displays information about all configured routes in the application as a
79+
table with the name, method, scheme, host and path for each route.
80+
81+
``debug:translation <locale>``
82+
Shows a table of the translation key, the domain, the translation and the
83+
fallback translation for all known messages, if translations exist for
84+
the given locale.
85+
86+
When in doubt how to use a console command, open the help section by appending
87+
the ``--help`` option.

0 commit comments

Comments
 (0)