Skip to content

Commit 811f6e8

Browse files
javiereguiluzweaverryan
authored andcommitted
Included a bunch of fixes suggested by the awesome Symfony doc reviewers
1 parent 940924c commit 811f6e8

File tree

4 files changed

+38
-27
lines changed

4 files changed

+38
-27
lines changed

quick_tour/the_architecture.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Understanding the Directory Structure
1313
The directory structure of a Symfony :term:`application` is rather flexible,
1414
but the recommended structure is as follows:
1515

16-
* ``app/``: the application configuration and templates;
16+
* ``app/``: the application configuration, templates and translations;
1717
* ``src/``: the project's PHP code;
1818
* ``vendor/``: the third-party dependencies;
1919
* ``web/``: the web root directory.
@@ -121,8 +121,8 @@ a single ``Bundle`` class that describes it::
121121
}
122122

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

127127
Configuring a Bundle
128128
~~~~~~~~~~~~~~~~~~~~
@@ -168,7 +168,7 @@ PHP. Have a look at this sample of the default Symfony configuration:
168168
169169
# ...
170170
171-
Each first level entry like ``framework``, ``twig`` or ``swiftmailer`` defines
171+
Each first level entry like ``framework``, ``twig`` and ``swiftmailer`` defines
172172
the configuration for a specific bundle. For example, ``framework`` configures
173173
the FrameworkBundle while ``swiftmailer`` configures the SwiftmailerBundle.
174174

@@ -238,10 +238,10 @@ Using Vendors
238238
-------------
239239

240240
Odds are that your application will depend on third-party libraries. Those
241-
should be stored in the ``vendor/`` directory and managed by Composer.
242-
This directory already contains the Symfony libraries, the SwiftMailer library,
243-
the Doctrine ORM, the Twig templating system and some other third party
244-
libraries and bundles.
241+
should be stored in the ``vendor/`` directory. You should never touch anything
242+
in this directory, because it is exclusively managed by Composer. This directory
243+
already contains the Symfony libraries, the SwiftMailer library, the Doctrine ORM,
244+
the Twig templating system and some other third party libraries and bundles.
245245

246246
Understanding the Cache and Logs
247247
--------------------------------

quick_tour/the_big_picture.rst

+22-15
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ to display the installed PHP version:
2323
Installing Symfony
2424
------------------
2525

26-
In the past, Symfony had to be installed manually for each new project. In order
27-
to simplify this set up, a new **Symfony Installer** was introduced recently.
28-
This means that the very first time you use Symfony on a computer, you have to
29-
install the Symfony Installer.
26+
In the past, Symfony had to be installed manually for each new project. Now you
27+
can use the **Symfony Installer**, which has to be installed the very first time
28+
you use Symfony on a computer.
3029

3130
On **Linux** and **Mac OS X** systems, execute the following console commands:
3231

@@ -52,9 +51,15 @@ to be able to execute the new ``symfony`` command:
5251
5352
$ symfony
5453
55-
On **Windows** systems, download the ``symfony.phar`` file from ........... and
56-
save it into the directory where you create the Symfony projects. Then you can
57-
execute the Symfony installer right away with this command:
54+
On **Windows** systems, execute the following console command:
55+
56+
.. code-block:: bash
57+
58+
c:\> php -r "readfile('https://symfony.com/installer');" | php
59+
60+
This command downloads a file called ``symfony.phar`` which contains the Symfony
61+
installer. Save or move that file to the directory where you create the Symfony
62+
projects and then, execute the Symfony installer right away with this command:
5863

5964
.. code-block:: bash
6065
@@ -90,7 +95,7 @@ the project directory and executing this command:
9095
.. code-block:: bash
9196
9297
$ cd myproject/
93-
$ php app/console server:start
98+
$ php app/console server:run
9499
95100
Open your browser and access the ``http://localhost:8000`` URL to see the
96101
Welcome page of Symfony:
@@ -166,9 +171,9 @@ that will be explained in the next section)::
166171
}
167172
}
168173

169-
In Symfony applications, **controllers** are PHP classes whose names are suffixed
170-
with the ``Controller`` word. In this example, the controller is called ``Default``
171-
and the PHP class is called ``DefaultController``.
174+
In Symfony applications, **controllers** are usually PHP classes whose names are
175+
suffixed with the ``Controller`` word. In this example, the controller is called
176+
``Default`` and the PHP class is called ``DefaultController``.
172177

173178
The methods defined in a controller are called **actions**, they are usually
174179
associated with one URL of the application and their names are suffixed with
@@ -230,8 +235,9 @@ of the ``Default`` controller when the user browses the ``/`` path of the applic
230235
.. tip::
231236

232237
In addition to PHP annotations, routes can be configured in YAML, XML or
233-
PHP files. This flexibility is one of the main features of Symfony, a
234-
framework that never imposes a particular configuration format on you.
238+
PHP files, as explained in `the Routing chapter of the Symfony book`_ .
239+
This flexibility is one of the main features of Symfony, a framework that
240+
never imposes a particular configuration format on you.
235241

236242
Templates
237243
~~~~~~~~~
@@ -348,6 +354,7 @@ Symfony makes it really easy to implement web sites better and faster. If you
348354
are eager to learn more about Symfony, dive into the next section:
349355
":doc:`The View <the_view>`".
350356

351-
.. _Composer: https://getcomposer.org/
357+
.. _Composer: https://getcomposer.org/
352358
.. _executable installer: http://getcomposer.org/download
353-
.. _Twig: http://twig.sensiolabs.org/
359+
.. _Twig: http://twig.sensiolabs.org/
360+
.. _the Routing chapter of the Symfony book: http://symfony.com/doc/current/book/routing.html

quick_tour/the_controller.rst

+4
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ In the case of ``404`` errors, Symfony includes a handy shortcut that you can
218218
use in your controllers::
219219

220220
// src/AppBundle/Controller/DefaultController.php
221+
// ...
222+
221223
class DefaultController extends Controller
222224
{
223225
/**
@@ -234,6 +236,8 @@ For ``500`` errors, just throw a regular PHP exception inside the controller and
234236
Symfony will transform it into a proper ``500`` error page::
235237

236238
// src/AppBundle/Controller/DefaultController.php
239+
// ...
240+
237241
class DefaultController extends Controller
238242
{
239243
/**

quick_tour/the_view.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ display the content of a variable passed by the controller depending on its type
6464
.. code-block:: jinja
6565
6666
{# 1. Simple variables #}
67-
{# $this->render( ..., array('name' => 'Fabien') ) #}
67+
{# $this->render('template.html.twig', array('name' => 'Fabien') ) #}
6868
{{ name }}
6969
7070
{# 2. Arrays #}
71-
{# $this->render( ..., array('user' => array('name' => 'Fabien')) ) #}
71+
{# $this->render('template.html.twig', array('user' => array('name' => 'Fabien')) ) #}
7272
{{ user.name }}
7373
7474
{# alternative syntax for arrays #}
7575
{{ user['name'] }}
7676
7777
{# 3. Objects #}
78-
{# $this->render( ..., array('user' => new User('Fabien')) ) #}
78+
{# $this->render('template.html.twig', array('user' => new User('Fabien')) ) #}
7979
{{ user.name }}
8080
{{ user.getName }}
8181
@@ -251,7 +251,7 @@ 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 another directory, read :doc:`this article <cookbook/assetic/asset_management>`
254+
If you store them in another directory, read :doc:`this article </cookbook/assetic/asset_management>`
255255
to learn how to manage web assets.
256256

257257
Using the ``asset`` function, your application is more portable. The reason is

0 commit comments

Comments
 (0)