Skip to content

Commit e188b2a

Browse files
committed
[quick_tour][big_picture] Fixing up some spacing and a few minor changes
1 parent 1349a14 commit e188b2a

File tree

1 file changed

+30
-27
lines changed

1 file changed

+30
-27
lines changed

quick_tour/the_big_picture.rst

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ should now have a ``sandbox/`` directory::
4949
Checking the Configuration
5050
--------------------------
5151

52-
Symfony2 comes with a visual server configuration tester to help avoid some
52+
Symfony2 comes with a visual server configuration tester to help avoid some
5353
headaches that come from web server or PHP misconfiguration. Use the following
5454
url to see the diagnostics for your server:
5555

5656
http://localhost/sandbox/web/check.php
5757

58-
Read the script output carefully and correct any oustanding issues.
58+
Read the script output carefully and correct any oustanding issues.
5959

6060
Now you can request your first "real" Symfony2 webpage:
6161

@@ -92,8 +92,8 @@ Fabien!``).
9292
Configuration
9393
~~~~~~~~~~~~~
9494

95-
Symfony2 configuration files can be written in PHP, XML or `YAML`_. The
96-
different types are compatible and may be used interchangeably within an
95+
Symfony2 configuration files can be written in PHP, XML or `YAML`_. The
96+
different types are compatible and may be used interchangeably within an
9797
application.
9898

9999
.. tip::
@@ -154,16 +154,17 @@ are a few examples of the routing configuration file for our application:
154154
155155
return $collection;
156156
157-
The first few lines of the routing configuration file define the code that is
158-
executed when the user requests the resource specified by the pattern "``/``" (i.e. the homepage).
159-
Here, it executes the "``index``" method of the "``Default``" controller inside the "``FrameworkBundle``"
157+
The first few lines of the routing configuration file define the code that
158+
is executed when the user requests the resource specified by the pattern
159+
"``/``" (i.e. the homepage). Here, it executes the ``index`` method of
160+
the ``Default`` controller inside the ``FrameworkBundle``.
160161

161-
Let's take a look at the last directive of
162-
the configuration file: Symfony2 can include routing information from
163-
other routing configuration files by using the ``import`` directive. In this
164-
case, we want to import the routing configuration from ``HelloBundle``. A
165-
bundle is like a plugin that has added power and we'll talk more about them
166-
later. For now, let's look at the routing configuration that we've imported:
162+
Take a look at the last directive of the configuration file: Symfony2 can
163+
include routing information from other routing configuration files by using
164+
the ``import`` directive. In this case, we want to import the routing configuration
165+
from ``HelloBundle``. A bundle is like a plugin that has added power and
166+
we'll talk more about them later. For now, let's look at the routing configuration
167+
that we've imported:
167168

168169
.. configuration-block::
169170

@@ -202,8 +203,9 @@ later. For now, let's look at the routing configuration that we've imported:
202203
return $collection;
203204
204205
As you can see, the "``/hello/{name}``" resource pattern is mapped to a controller,
205-
referenced by the ``_controller`` value. The string enclosed in curly brackets (``{name}``) is a placeholder
206-
and defines an argument that will be available in the controller.
206+
referenced by the ``_controller`` value. The string enclosed in curly brackets
207+
(``{name}``) is a placeholder and defines an argument that will be available
208+
in the controller.
207209

208210
.. index::
209211
single: Controller
@@ -235,20 +237,21 @@ The controller defines actions to handle users requests and prepares responses
235237
}
236238
}
237239
238-
Let's explain this code line by line:
240+
The code is pretty straightforward but let's explain it line by line:
239241

240242
* *line 3*: Symfony2 takes advantage of new PHP 5.3 namespacing features,
241-
and all controllers should be properly namespaced. As you can see, the namespace has
242-
a correlation to the actual file location. This is not required, but a best practice.
243-
In this example, the controller lives in the bundle named ``HelloBundle``,
244-
which forms the first part of the ``_controller`` routing value.
245-
243+
and all controllers should be properly namespaced. As you can see, the
244+
namespace has a correlation to the actual file location. In this example,
245+
the controller lives in the bundle named ``HelloBundle``, which forms the
246+
first part of the ``_controller`` routing value.
247+
246248

247249
* *line 7*: The controller name is the combination of the second part of the
248250
``_controller`` routing value (``Hello``) and the word ``Controller``. It
249251
extends the built-in ``Controller`` class, which provides useful shortcuts
250-
(as we will see later in this tutorial). The ``Controller`` resides in ``Symfony\Bundle\FrameworkBundle\Controller\Controller``
251-
which we defined in line 5
252+
(as we will see later in this tutorial). The ``Controller`` resides in
253+
``Symfony\Bundle\FrameworkBundle\Controller\Controller`` which we defined
254+
on line 5.
252255

253256
* *line 9*: Each controller consists of several actions. As per the routing
254257
configuration, the hello page is handled by the ``index`` action (the third
@@ -272,7 +275,7 @@ developers. In our example, we only have one bundle, ``HelloBundle``.
272275
Templates
273276
~~~~~~~~~
274277

275-
The controller renders the ``HelloBundle:Hello:index.html.twig`` template. By
278+
The controller renders the ``HelloBundle:Hello:index.html.twig`` template. By
276279
default, the sandbox uses Twig as its template engine but you can also use
277280
traditional PHP templates if you choose.
278281

@@ -327,9 +330,9 @@ your changes will appear immediately.
327330
Final Thoughts
328331
--------------
329332

330-
Thanks for trying out Symfony2! By now, you should be able to create your own
331-
simple routes, controllers and templates. As an exercise, try to build
332-
something more useful than the Hello application! If you are eager to
333+
Thanks for trying out Symfony2! By now, you should be able to create your own
334+
simple routes, controllers and templates. As an exercise, try to build
335+
something more useful than the Hello application! If you are eager to
333336
learn more about Symfony2, dive into the next section: "The View".
334337

335338
.. _sandbox: http://symfony-reloaded.org/code#sandbox

0 commit comments

Comments
 (0)