Skip to content

Commit 940924c

Browse files
javiereguiluzweaverryan
authored andcommitted
Added a bunch of fixes suggested by @xabbuh
1 parent 6105acb commit 940924c

File tree

4 files changed

+33
-30
lines changed

4 files changed

+33
-30
lines changed

quick_tour/the_architecture.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ a single ``Bundle`` class that describes it::
122122

123123
In addition to the AppBundle that was already talked about, notice that the
124124
kernel also enables other bundles such as the FrameworkBundle, DoctrineBundle,
125-
SwiftmailerBundle and AsseticBundle bundle. They are all part of the core framework.
125+
SwiftmailerBundle and AsseticBundle. They are all part of the core framework.
126126

127127
Configuring a Bundle
128128
~~~~~~~~~~~~~~~~~~~~
@@ -213,7 +213,7 @@ the location of the AppBundle.
213213
Logical Controller Names
214214
........................
215215

216-
For controllers, you need to reference action using the format
216+
For controllers, you need to reference actions using the format
217217
``BUNDLE_NAME:CONTROLLER_NAME:ACTION_NAME``. For instance,
218218
``AppBundle:Default:index`` maps to the ``indexAction`` method from the
219219
``AppBundle\Controller\DefaultController`` class.
@@ -240,7 +240,7 @@ Using Vendors
240240
Odds are that your application will depend on third-party libraries. Those
241241
should be stored in the ``vendor/`` directory and managed by Composer.
242242
This directory already contains the Symfony libraries, the SwiftMailer library,
243-
the Doctrine ORM, the Twig templating system, and some other third party
243+
the Doctrine ORM, the Twig templating system and some other third party
244244
libraries and bundles.
245245

246246
Understanding the Cache and Logs

quick_tour/the_big_picture.rst

+15-13
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ to display the installed PHP version:
1616

1717
.. code-block:: bash
1818
19-
php --version
19+
$ php --version
2020
2121
.. _installing-symfony2:
2222

@@ -37,12 +37,13 @@ On **Linux** and **Mac OS X** systems, execute the following console commands:
3737
3838
.. note::
3939

40-
If your system doesn't have cURL installed, execute instead the following
41-
command:
40+
If your system doesn't have cURL installed, execute the following
41+
commands instead:
4242

4343
.. code-block:: bash
4444
4545
$ php -r "readfile('https://symfony.com/installer');" | php
46+
$ sudo mv symfony.phar /usr/local/bin/symfony
4647
4748
After installing the Symfony installer, you'll have to open a new console window
4849
to be able to execute the new ``symfony`` command:
@@ -214,16 +215,17 @@ A **PHP annotation** is a convenient way to configure a method without having to
214215
write regular PHP code. Beware that annotation blocks start with ``/**``, whereas
215216
regular PHP comments start with ``/*``.
216217

217-
The first value of ``@Route()`` defines the path that will trigger the execution
218-
of the action. This path is configured via a relative URL, so you don't have to
219-
add the host of your application (e.g. ```http://example.com``). In this case,
220-
the value ``/`` refers to the application homepage. The second value of ``@Route()``
221-
(e.g. ``name="homepage"``) is optional and sets the name of this route. For now
222-
this name is not needed, but later it'll be useful for linking pages.
218+
The first value of ``@Route()`` defines the URL that will trigger the execution
219+
of the action. As you don't have to add the host of your application to the URL
220+
(e.g. ```http://example.com``), these URLs are always relative and they are usually
221+
called *paths*. In this case, the ``/`` path refers to the application homepage.
222+
The second value of ``@Route()`` (e.g. ``name="homepage"``) is optional and sets
223+
the name of this route. For now this name is not needed, but later it'll be useful
224+
for linking pages.
223225

224226
Considering all this, the ``@Route("/", name="homepage")`` annotation creates a
225227
new route called ``homepage`` which makes Symfony execute the ``index`` action
226-
of the ``Default`` controller when the users browses the ``/`` URL of the application.
228+
of the ``Default`` controller when the user browses the ``/`` path of the application.
227229

228230
.. tip::
229231

@@ -259,7 +261,7 @@ the following code:
259261
{% endblock %}
260262

261263
This template is created with `Twig`_, a new template engine created for modern
262-
PHP applications. The :doc:`second part of this tutorial</quick_tour/the_view>`
264+
PHP applications. The :doc:`second part of this tutorial </quick_tour/the_view>`
263265
will introduce how templates work in Symfony.
264266

265267
.. _quick-tour-big-picture-environments:
@@ -287,8 +289,8 @@ may be worried about your visitors accessing sensible information. Symfony is
287289
aware of this issue and for that reason, it won't display this bar when your
288290
application is running in the production server.
289291

290-
How does Symfony knows when is your application running locally or in a production
291-
server? Keep reading to discover the concept of **execution environments**.
292+
How does Symfony know whether your application is running locally or on a
293+
production server? Keep reading to discover the concept of **execution environments**.
292294

293295
.. _quick-tour-big-picture-environments-intro:
294296

quick_tour/the_controller.rst

+9-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ any action of any controller is the creation of a ``Response`` object which
1414
Symfony uses to generate the HTML content returned to the user.
1515

1616
So far, all the actions shown in this tutorial used the ``$this->render()``
17-
shortcut to return a rendered response as result. If case you need it, you can
17+
shortcut to return a rendered response as result. In case you need it, you can
1818
also create a raw ``Response`` object to return any text content::
1919

2020
// src/AppBundle/Controller/DefaultController.php
@@ -125,7 +125,7 @@ its default value::
125125
}
126126

127127
Obviously, when you support several request formats, you have to provide a
128-
tempalte for each of the supported formats. In this case, you should create a
128+
template for each of the supported formats. In this case, you should create a
129129
new ``hello.xml.twig`` template:
130130

131131
.. code-block:: xml+php
@@ -144,7 +144,7 @@ in your browser.
144144

145145
That's all there is to it. For standard formats, Symfony will also
146146
automatically choose the best ``Content-Type`` header for the response. To
147-
restrict the the formats supported by a given action, use the ``requirements``
147+
restrict the formats supported by a given action, use the ``requirements``
148148
option of the ``@Route()`` annotation::
149149

150150
// src/AppBundle/Controller/DefaultController.php
@@ -190,9 +190,8 @@ method::
190190
}
191191
}
192192

193-
The ``redirectToRoute()`` is similar to the ``path()`` function used in the
194-
templates. It takes the route name and an array of parameters as arguments and
195-
returns the associated friendly URL.
193+
The ``redirectToRoute()`` method takes as arguments the route name and an optional
194+
array of parameters and redirects the user to the URL generated with those arguments.
196195

197196
You can also internally forward the action to another action of the same or
198197
different controller using the ``forward()`` method::
@@ -226,6 +225,7 @@ use in your controllers::
226225
*/
227226
public function indexAction()
228227
{
228+
// ...
229229
throw $this->createNotFoundException();
230230
}
231231
}
@@ -241,6 +241,7 @@ Symfony will transform it into a proper ``500`` error page::
241241
*/
242242
public function indexAction()
243243
{
244+
// ...
244245
throw new \Exception('Something went horribly wrong!');
245246
}
246247
}
@@ -249,7 +250,7 @@ Getting Information from the Request
249250
------------------------------------
250251

251252
Sometimes your controllers need to access the information related to the user
252-
request, such as his/her preferred language, IP address or the URL query parameters.
253+
request, such as their preferred language, IP address or the URL query parameters.
253254
To get access to this information, add a new argument of type ``Request`` to the
254255
action. The name of this new argument doesn't matter, but it must be preceded
255256
by the ``Request`` type in order to work (don't forget to add the new ``use``
@@ -346,4 +347,4 @@ That's all there is to it, and I'm not even sure you'll have spent the full
346347
10 minutes. You were briefly introduced to bundles in the first part, and all the
347348
features you've learned about so far are part of the core framework bundle.
348349
But thanks to bundles, everything in Symfony can be extended or replaced.
349-
That's the topic of the :doc:`next part of this tutorial<the_architecture>`.
350+
That's the topic of the :doc:`next part of this tutorial <the_architecture>`.

quick_tour/the_view.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Below is a minimal template that illustrates a few basics, using two variables
5050

5151
To render a template in Symfony, use the ``render`` method from within a controller.
5252
If the template needs variables to generate its contents, pass them as an array
53-
using the second optional second argument::
53+
using the second optional argument::
5454

5555
$this->render('default/index.html.twig', array(
5656
'variable_name' => 'variable_value',
@@ -156,7 +156,7 @@ The best way to share a snippet of code between several templates is to create a
156156
new template fragment that can then be included from other templates.
157157

158158
Imagine that we want to display ads on some pages of our application. First,
159-
create an ``banner.html.twig`` template:
159+
create a ``banner.html.twig`` template:
160160

161161
.. code-block:: jinja
162162
@@ -229,8 +229,8 @@ updated by just changing the configuration:
229229

230230
<a href="{{ path('homepage') }}">Return to homepage</a>
231231

232-
The ``path`` function takes the route name as the first argument and optionally
233-
you can pass an array of route parameters as the second argument.
232+
The ``path`` function takes the route name as the first argument and you can
233+
optionally pass an array of route parameters as the second argument.
234234

235235
.. tip::
236236

@@ -251,8 +251,8 @@ Symfony provides the ``asset`` function to deal with them easily:
251251
<img src="{{ asset('images/logo.png') }}" />
252252
253253
The ``asset()`` function looks for the web assets inside the ``web/`` directory.
254-
If you store them in other directory, read ..... this article to learn how to
255-
manage web assets.
254+
If you store them in another directory, read :doc:`this article <cookbook/assetic/asset_management>`
255+
to learn how to manage web assets.
256256

257257
Using the ``asset`` function, your application is more portable. The reason is
258258
that you can move the application root directory anywhere under your web root

0 commit comments

Comments
 (0)