@@ -145,7 +145,7 @@ Symfony is architected to match this reality.
145145Requests and Responses in Symfony
146146---------------------------------
147147
148- PHP comes packaged with an array variables and methods that allow the developer
148+ PHP comes packaged with array variables and methods that allow the developer
149149to understand each request and send a response. For request information,
150150PHP prepares superglobal variables such as ``$_SERVER `` and ``$_GET ``.
151151Recall that each raw request is simply an HTTP-formatted block of text.
@@ -221,8 +221,8 @@ The Journey from the Request to the Response
221221We know now that the end goal of any application is to use the HTTP
222222request to create and return the appropriate HTTP response. Symfony provides
223223``Request `` and ``Response `` classes that allow this to be done through
224- an object-oriented interface. Though, so far, we're only leveraging a small
225- piece of Symfony, we already have the tools to write a simple application!
224+ an object-oriented interface. So far, we're only leveraging a small
225+ piece of Symfony. But we already have the tools to write a simple application!
226226Let's dive in:
227227
228228.. code-block :: php
@@ -241,14 +241,14 @@ Let's dive in:
241241 $response->send();
242242
243243 In this simple example, the application correctly processes the request and
244- returns an appropriate response. From a very technical standpoint, then, our
244+ returns an appropriate response. From a very technical standpoint, our
245245application does exactly what it should.
246246
247247An Application without a Framework
248248~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
249249
250250But what if the application needs to grow? Imagine this same application if it
251- were forced now to handle hundreds or even thousands of different pages! In
251+ were now forced to handle hundreds or even thousands of different pages! In
252252order to keep things maintainable (i.e. not all in one file), we'd need to do
253253some reorganization. For starters, we might move the work of creating the
254254``Response `` into a set of different functions. These functions are commonly
@@ -280,7 +280,8 @@ known as *controllers* and allow us to further organize our code::
280280Next, our growing application still contains a long ``if `` ``elseif `` block
281281that routes the creation of the ``Response `` object to a different controller
282282(i.e. PHP method). We might consider building a configuration-based routing
283- system that maps each request (by URI and HTTP method) to a specific controller.
283+ system that maps each request to a specific controller based on the URI and
284+ HTTP method of the request.
284285
285286Obvious or not, the application is beginning to spin out of control. Recall
286287that the goal of any application is to apply the custom application logic and
@@ -309,15 +310,15 @@ for use.
309310Introducing the Symfony Kernel
310311~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
311312
312- Symfony is based around a ``Kernel `` object whose only job is to facilitate
313+ Symfony is based around a ``Kernel `` object whose single responsibility is to facilitate
313314the journey from the ``Request `` object to the final ``Response `` object.
314315The ``Kernel `` is what handles each request and actually executes your application
315316code.
316317
317- The "application code" that's executed by the ``Kernel `` is called a "controller",
318+ The "application code" executed by the ``Kernel `` is called a "controller",
318319a special term for what's actually a basic PHP callable (most commonly,
319320an object method). The controller is where your application code lives -
320- it's where you create the final ``Response `` object. The Kernel works by
321+ it's where you create the final ``Response `` object. The `` Kernel `` works by
321322determining and then calling a "Controller" for each request:
322323
323324.. code-block :: text
@@ -384,7 +385,7 @@ In reality, everything we've talked about so far (the ``Request``, ``Response``,
384385used by Symfony. In fact, each feature in Symfony2 belongs to one of over
385386twenty independent libraries (called the "Symfony Components")! Even if you
386387decided to build your own PHP framework (an unwise idea), you could use the
387- Symfony2 Components as the building blocks for many layers of functionality.
388+ Symfony Components as the building blocks for many layers of functionality.
388389And if you do use Symfony2, but need to replace a component entirely, you have
389390the ability to do that. Symfony2 is decoupled and relies on interface-driven
390391dependency injection. In other words, the developer has complete control.
@@ -395,7 +396,7 @@ a PHP framework that accomplishes two distinct tasks:
395396#. Provides a selection of components (i.e. the Symfony2 Components) and
396397 third-party libraries.
397398
398- #. Provides sensible configuration that ties everything together nicely .
399+ #. Provides sensible configuration that nicely ties everything together.
399400
400401The goal of the framework is to integrate many independent tools in order
401402to provide a consistent experience for the developer. Even the framework
0 commit comments