File tree 4 files changed +10
-8
lines changed
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::
12
12
$translator = new Translator('fr_FR');
13
13
$translator->addLoader('array', new ArrayLoader());
14
14
$translator->addResource('array', array(
15
- 'Symfony is great!' => 'J\'aime Symfony!',
15
+ 'Symfony is great!' => 'Symfony est super !',
16
16
), 'fr_FR');
17
17
18
18
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:
72
72
#. Defined in a class that extends from
73
73
:class: `Symfony\\ Component\\ Console\\ Command\\ Command `.
74
74
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 >`.
77
77
78
78
Executing the Command
79
79
---------------------
@@ -166,7 +166,7 @@ Now, you can pass the username to the command:
166
166
Getting Services from the Service Container
167
167
-------------------------------------------
168
168
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
170
170
:doc: `services </service_container >`. This can be done by making the command
171
171
extend the :class: `Symfony\\ Bundle\\ FrameworkBundle\\ Command\\ ContainerAwareCommand `
172
172
instead::
Original file line number Diff line number Diff line change @@ -192,7 +192,9 @@ Structure
192
192
* Do not use ``else ``, ``elseif ``, ``break `` after ``if `` and ``case `` conditions
193
193
which return or throw something;
194
194
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.
196
198
197
199
Naming Conventions
198
200
~~~~~~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -499,12 +499,12 @@ redirect between them.
499
499
Symfony follows this logic to redirect between URLs with and without trailing
500
500
slashes (but only for ``GET `` and ``HEAD `` requests):
501
501
502
- ---------- ---------------------------------------- ------------------------------------------
502
+ ========== ======================================== ==========================================
503
503
Route path If the requested URL is ``/foo `` If the requested URL is ``/foo/ ``
504
- ---------- ---------------------------------------- ------------------------------------------
504
+ ========== ======================================== ==========================================
505
505
``/foo `` It matches (``200 `` status response) It doesn't match (``404 `` status response)
506
506
``/foo/ `` It makes a ``301 `` redirect to ``/foo/ `` It matches (``200 `` status response)
507
- ---------- ---------------------------------------- ------------------------------------------
507
+ ========== ======================================== ==========================================
508
508
509
509
In summary, adding a trailing slash in the route path is the best way to ensure
510
510
that both URLs work. Read the :doc: `/routing/redirect_trailing_slash ` article to
You can’t perform that action at this time.
0 commit comments