File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Imagine you want to translate the string *"Symfony is great"* into French::
1212 $translator = new Translator('fr_FR');
1313 $translator->addLoader('array', new ArrayLoader());
1414 $translator->addResource('array', array(
15- 'Symfony is great!' => 'J\'aime Symfony!',
15+ 'Symfony is great!' => 'Symfony est super !',
1616 ), 'fr_FR');
1717
1818 var_dump($translator->trans('Symfony is great!'));
Original file line number Diff line number Diff line change @@ -72,8 +72,8 @@ automatically, a command must be:
7272#. Defined in a class that extends from
7373 :class: `Symfony\\ Component\\ Console\\ Command\\ Command `.
7474
75- If you can't meet these conditions for some command, the alternative is to
76- manually :doc`register the command as a service </console/commands_as_services>`.
75+ If you can't meet these conditions for a command, the alternative is to manually
76+ :doc: `register the command as a service </console/commands_as_services >`.
7777
7878Executing the Command
7979---------------------
@@ -166,7 +166,7 @@ Now, you can pass the username to the command:
166166Getting Services from the Service Container
167167-------------------------------------------
168168
169- To actually create a new user, the command has to access to some
169+ To actually create a new user, the command has to access some
170170:doc: `services </service_container >`. This can be done by making the command
171171extend the :class: `Symfony\\ Bundle\\ FrameworkBundle\\ Command\\ ContainerAwareCommand `
172172instead::
Original file line number Diff line number Diff line change @@ -192,7 +192,9 @@ Structure
192192* Do not use ``else ``, ``elseif ``, ``break `` after ``if `` and ``case `` conditions
193193 which return or throw something;
194194
195- * Do not use spaces around ``[ `` offset accessor and before ``] `` offset accessor.
195+ * Do not use spaces around ``[ `` offset accessor and before ``] `` offset accessor;
196+
197+ * Add a ``use `` statement for every class that is not part of the global namespace.
196198
197199Naming Conventions
198200~~~~~~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -499,12 +499,12 @@ redirect between them.
499499Symfony follows this logic to redirect between URLs with and without trailing
500500slashes (but only for ``GET `` and ``HEAD `` requests):
501501
502- ---------- ---------------------------------------- ------------------------------------------
502+ ========== ======================================== ==========================================
503503Route path If the requested URL is ``/foo `` If the requested URL is ``/foo/ ``
504- ---------- ---------------------------------------- ------------------------------------------
504+ ========== ======================================== ==========================================
505505``/foo `` It matches (``200 `` status response) It doesn't match (``404 `` status response)
506506``/foo/ `` It makes a ``301 `` redirect to ``/foo/ `` It matches (``200 `` status response)
507- ---------- ---------------------------------------- ------------------------------------------
507+ ========== ======================================== ==========================================
508508
509509In summary, adding a trailing slash in the route path is the best way to ensure
510510that both URLs work. Read the :doc: `/routing/redirect_trailing_slash ` article to
You can’t perform that action at this time.
0 commit comments