@@ -41,6 +41,9 @@ Symfony is built from the ground up around that reality. Whether you realize
4141it or not, HTTP is something you use every day. With Symfony, you'll learn
4242how to master it.
4343
44+ .. index ::
45+ single: HTTP; Request-response paradigm
46+
4447Step1: The Client Sends a Request
4548~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4649
@@ -98,10 +101,10 @@ delete a specific blog entry, for example:
98101 but many of them are not widely used or supported. In reality, many
99102 modern browsers only support ``POST `` and ``GET `` in HTML forms. Various
100103 others are however supported in `XMLHttpRequest `_, as well as by Symfony's
101- :doc: `router </components/routing/introduction >`.
104+ :doc: `Routing component </components/routing/introduction >`.
102105
103- In addition to the first line, an HTTP request invariably contains other
104- lines of information called request headers. The headers can supply a wide
106+ In addition to the first line, a HTTP request invariably contains other
107+ lines of information called request ** headers ** . The headers can supply a wide
105108range of information such as the host of the resource being requested (``Host ``),
106109the response formats the client accepts (``Accept ``) and the application the
107110client is using to make the request (``User-Agent ``). Many other headers exist
@@ -252,17 +255,18 @@ have all the request information at your fingertips::
252255``Request `` class has several public properties via which we can access information
253256about the client request. As seen above, the ``$_GET `` and ``$_POST `` PHP global
254257variables are accessible via the public ``query `` and ``request `` properties
255- respectively, ``$_COOKIE `` is accessible via ``cookies ``, ``$_FILES `` via ``files ``
256- and ``$_SERVER `` via ``server ``. ``headers `` property is mostly equivalent to
257- a subset of ``$_SERVER `` (e.g. $request->headers->get('User-Agent')). Each property is a
258+ respectively, ``$_COOKIE `` is accessible via ``cookies `` property, ``$_FILES ``
259+ via ``files `` property and ``$_SERVER `` via ``server `` property. ``headers ``
260+ property is mostly equivalent to a subset of ``$_SERVER ``
261+ (e.g. $request->headers->get('User-Agent')). Each property is a
258262:class: `Symfony\\ Component\\ HttpFoundation\\ ParameterBag ` instance (or a sub-class
259263of: :class: `Symfony\\ Component\\ HttpFoundation\\ ServerBag `,
260264:class: `Symfony\\ Component\\ HttpFoundation\\ FileBag `,
261- :class: `Symfony\\ Component\\ HttpFoundation\\ HeaderBag `,
265+ :class: `Symfony\\ Component\\ HttpFoundation\\ HeaderBag `
262266), which is a data holder class. All ``ParameterBag `` instances have methods to
263267retrieve and update their data like: ``get() `` to return a parameter by name,
264268``has() `` to return true if the parameter is defined, ``all() `` to return all
265- the parameters and many more...
269+ the parameters and many more.
266270
267271.. _book-fundamentals-attributes :
268272
@@ -438,7 +442,7 @@ the same simple pattern for every request:
438442 :align: center
439443 :alt: Symfony request flow
440444
441- Incoming requests are interpreted by the :doc: `router component </book/routing>` and
445+ Incoming requests are interpreted by the :doc: `Routing component </book/routing>` and
442446 passed to PHP functions that return ``Response `` objects.
443447
444448Each "page" of your site is defined in a routing configuration file that
@@ -509,7 +513,7 @@ When someone visits the ``/contact`` page, this route is matched, and the
509513specified controller is executed. As you'll learn in the
510514:ref: `routing chapter <controller-string-syntax >`, the ``AppBundle:Main:contact ``
511515string is a short syntax named *logical controller name * that points to a specific
512- controller ``contactAction() `` inside a controller class called ``MainController)+ ``.
516+ controller ``contactAction() `` inside a controller class called ``MainController ``.
513517In the routing chapter you will also learn about routing parameters like
514518``_controller ``, ``_route `` and the ``defaults `` array.
515519
@@ -529,13 +533,13 @@ object with the HTML ``<h1>Contact us!</h1>``::
529533 }
530534 }
531535
532- In the :doc: `controller chapter </book/controller >`, you'll learn how a controller can
536+ In the :doc: `Controller chapter </book/controller >`, you'll learn how a controller can
533537render templates, allowing your "presentation" code (i.e. anything that actually
534538writes out HTML) to live in a separate template file. This frees up the controller
535539to worry only about the hard stuff: interacting with the database, handling
536540submitted data, or sending email messages.
537541
538- - .. _symfony2-build-your-app-not-your-tools:
542+ .. _symfony2-build-your-app-not-your-tools :
539543
540544Symfony: Build your App, not your Tools
541545---------------------------------------
0 commit comments