Skip to content

Commit 5b3a572

Browse files
javiereguiluzweaverryan
authored andcommitted
[quick_tour] finished the review of "The Big Picture" chapter
1 parent f24eabc commit 5b3a572

File tree

2 files changed

+23
-51
lines changed

2 files changed

+23
-51
lines changed

images/quick_tour/profiler.png

804 KB
Loading

quick_tour/the_big_picture.rst

Lines changed: 23 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ will be executed. In the next section, you'll learn exactly what that means.
146146
.. tip::
147147

148148
In addition to YAML format, routes can be configured in XML or PHP files
149-
and even embedded in PHP annotations. This flexibility is one of the main
149+
and even embedded in PHP annotations. This flexibility is one of the main
150150
features of Symfony2, a framework that never imposes you a particular
151151
configuration format.
152152

@@ -251,7 +251,7 @@ file, routes are defined as annotations on action methods::
251251
// ...
252252
}
253253

254-
The ``@Route()`` annotation creates a new route matching the ``/hello/{name}``
254+
The ``@Route()`` annotation creates a new route matching the ``/hello/{name}``
255255
path to the ``helloAction()`` method. Any string enclosed in curly brackets,
256256
like ``{name}``, is considered a variable that can be directly retrieved as a
257257
method argument with the same name.
@@ -281,9 +281,9 @@ template (or ``AcmeDemoBundle:Demo:hello.html.twig`` if you use the logical name
281281
<h1>Hello {{ name }}!</h1>
282282
{% endblock %}
283283
284-
By default, Symfony2 uses `Twig`_ as its template engine but you can also use
285-
traditional PHP templates if you choose. The next chapter will introduce how
286-
templates work in Symfony2.
284+
By default, Symfony2 uses `Twig <http://twig.sensiolabs.org/>` as its template
285+
engine but you can also use traditional PHP templates if you choose. The next
286+
chapter will introduce how templates work in Symfony2.
287287

288288
Bundles
289289
~~~~~~~
@@ -309,26 +309,15 @@ Symfony2 developer's best friend!
309309
.. image:: /images/quick_tour/web_debug_toolbar.png
310310
:align: center
311311

312-
But what you see initially is only the tip of the iceberg; click on the
313-
hexadecimal number (the session token) to reveal yet another very useful
314-
Symfony2 debugging tool: the profiler.
312+
But what you see initially is only the tip of the iceberg; click on any of the
313+
bar sections to open the profiler and get much more detailed information about
314+
the request, the query parameters, security details, and database queries:
315315

316316
.. image:: /images/quick_tour/profiler.png
317317
:align: center
318318

319-
.. note::
320-
321-
You can also get more information quickly by hovering over the items
322-
on the Web Debug Toolbar, or clicking them to go to their respective
323-
pages in the profiler.
324-
325-
When loaded and enabled (by default in the ``dev`` :ref:`environment<quick-tour-big-picture-environments-intro>`),
326-
the Profiler provides a web interface for a *huge* amount of information recorded
327-
on each request, including logs, a timeline of the request, GET or POST parameters,
328-
security details, database queries and more!
329-
330-
Of course, it would be unwise to have these tools enabled when you deploy
331-
your application, so by default, the profiler is not enabled in the ``prod``
319+
Of course, it would be unwise to have this tool enabled when you deploy your
320+
application, so by default, the profiler is not enabled in the ``prod``
332321
environment.
333322

334323
.. _quick-tour-big-picture-environments-intro:
@@ -338,7 +327,7 @@ So what *is* an environment? An :term:`Environment` is a simple string (e.g.
338327
to run your application.
339328

340329
Typically, you put your common configuration in ``config.yml`` and override
341-
where necessary in the configuration for each environment. For example:
330+
where necessary in the specific configuration file for each environment:
342331

343332
.. code-block:: yaml
344333
@@ -356,33 +345,24 @@ enabling the web debug toolbar.
356345

357346
When you visit the ``app_dev.php`` file in your browser, you're executing
358347
your Symfony application in the ``dev`` environment. To visit your application
359-
in the ``prod`` environment, visit the ``app.php`` file instead. The demo
360-
routes in our application are only available in the ``dev`` environment, but
361-
if those routes were available in the ``prod`` environment, you would be able
362-
to visit them in the ``prod`` environment by going to:
363-
364-
.. code-block:: text
365-
366-
http://localhost/app.php/demo/hello/Fabien
348+
in the ``prod`` environment, visit the ``app.php`` file instead.
367349

368-
If instead of using php's built-in webserver, you use Apache with ``mod_rewrite``
369-
enabled and take advantage of the ``.htaccess`` file Symfony2 provides
370-
in ``web/``, you can even omit the ``app.php`` part of the URL. The default
371-
``.htaccess`` points all requests to the ``app.php`` front controller:
350+
The demo routes in our application are only available in the ``dev`` environment.
351+
Therefore, if you try to access the ``http://localhost/app.php/demo/hello/Fabien``
352+
URL, you'll get a 404 error.
372353

373-
.. code-block:: text
354+
.. tip::
374355

375-
http://localhost/demo/hello/Fabien
356+
If instead of using PHP built-in webserver, you use Apache with ``mod_rewrite``
357+
enabled and take advantage of the ``.htaccess`` file Symfony2 provides
358+
in ``web/``, you can even omit the ``app.php`` part of the URL. The default
359+
``.htaccess`` points all requests to the ``app.php`` front controller:
376360

377-
.. note::
361+
.. code-block:: text
378362
379-
Note that the two URLs above are provided here only as **examples** of
380-
how a URL looks like when the ``prod`` front controller is used. If you
381-
actually try them in an out-of-the-box installation of *Symfony Standard Edition*,
382-
you will get a 404 error since the *AcmeDemoBundle* is enabled only in
383-
the ``dev`` environment and its routes imported from ``app/config/routing_dev.yml``.
363+
http://localhost/demo/hello/Fabien
384364
385-
For more details on environments, see ":ref:`Environments & Front Controllers<page-creation-environments>`".
365+
For more details on environments, see ":ref:`Environments & Front Controllers<page-creation-environments>`" article.
386366

387367
Final Thoughts
388368
--------------
@@ -392,11 +372,3 @@ hard, was it? There's a lot more to explore, but you should already see how
392372
Symfony2 makes it really easy to implement web sites better and faster. If you
393373
are eager to learn more about Symfony2, dive into the next section:
394374
":doc:`The View<the_view>`".
395-
396-
.. _Symfony2 Standard Edition: http://symfony.com/download
397-
.. _Symfony in 5 minutes: http://symfony.com/symfony-in-five-minutes
398-
.. _`Composer`: http://getcomposer.org/
399-
.. _Separation of Concerns: http://en.wikipedia.org/wiki/Separation_of_concerns
400-
.. _annotations in controllers: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html#annotations-for-controllers
401-
.. _Twig: http://twig.sensiolabs.org/
402-
.. _`Symfony Installation Page`: http://symfony.com/download

0 commit comments

Comments
 (0)