Skip to content

Commit c8ce507

Browse files
committed
Other minor fixes
1 parent 3c71b6d commit c8ce507

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

book/http_fundamentals.rst

+18-22
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ applications, while staying out of your way. Symfony is built on the best
1414
ideas from many technologies: the tools and concepts you're about to learn
1515
represent the efforts of thousands of people, over many years. In other words,
1616
you're not just learning "Symfony", you're learning the fundamentals of the
17-
web, development best practices, and how to use many amazing new PHP libraries,
17+
web, development best practices and how to use many amazing new PHP libraries,
1818
inside or independently of Symfony. So, get ready.
1919

2020
True to the Symfony philosophy, this chapter begins by explaining the fundamental
@@ -33,9 +33,9 @@ takes place:
3333
:align: center
3434

3535
And while the actual language used is a bit more formal, it's still dead-simple.
36-
HTTP is the term used to describe this simple text-based language. And no
37-
matter how you develop on the web, the goal of your server is *always* to
38-
understand simple text requests, and return simple text responses.
36+
HTTP is the term used to describe this simple text-based language. No matter
37+
how you develop on the web, the goal of your server is *always* to understand
38+
simple text requests, and return simple text responses.
3939

4040
Symfony is built from the ground up around that reality. Whether you realize
4141
it or not, HTTP is something you use everyday. With Symfony, you'll learn
@@ -48,7 +48,7 @@ Step1: The Client Sends a Request
4848
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4949

5050
Every conversation on the web starts with a *request*. The request is a text
51-
message created by a client (e.g. a browser, an iPhone app, etc) in a
51+
message created by a client (e.g. a browser, a smartphone app, etc) in a
5252
special format known as HTTP. The client sends that request to a server,
5353
and then waits for the response.
5454

@@ -98,7 +98,7 @@ delete a specific blog entry, for example:
9898

9999
There are actually nine HTTP methods defined by the HTTP specification,
100100
but many of them are not widely used or supported. In reality, many modern
101-
browsers don't support the ``PUT`` and ``DELETE`` methods.
101+
browsers don't even support the ``PUT`` and ``DELETE`` methods.
102102

103103
In addition to the first line, an HTTP request invariably contains other
104104
lines of information called request headers. The headers can supply a wide
@@ -161,7 +161,7 @@ communication on the web. And as important and powerful as this process is,
161161
it's inescapably simple.
162162

163163
The most important fact is this: regardless of the language you use, the
164-
type of application you build (web, mobile, JSON API), or the development
164+
type of application you build (web, mobile, JSON API) or the development
165165
philosophy you follow, the end goal of an application is **always** to understand
166166
each request and create and return the appropriate response.
167167

@@ -277,6 +277,7 @@ an HTTP response message. This allows your application to use an object-oriented
277277
interface to construct the response that needs to be returned to the client::
278278

279279
use Symfony\Component\HttpFoundation\Response;
280+
280281
$response = new Response();
281282

282283
$response->setContent('<html><body><h1>Hello world!</h1></body></html>');
@@ -366,12 +367,13 @@ on that value. This can get ugly quickly::
366367
// index.php
367368
use Symfony\Component\HttpFoundation\Request;
368369
use Symfony\Component\HttpFoundation\Response;
370+
369371
$request = Request::createFromGlobals();
370372
$path = $request->getPathInfo(); // the URI path being requested
371373

372374
if (in_array($path, array('', '/'))) {
373375
$response = new Response('Welcome to the homepage.');
374-
} elseif ($path == '/contact') {
376+
} elseif ('/contact' === $path) {
375377
$response = new Response('Contact us');
376378
} else {
377379
$response = new Response('Page not found.', 404);
@@ -485,8 +487,8 @@ email messages.
485487

486488
.. _symfony2-build-your-app-not-your-tools:
487489

488-
Symfony: Build your App, not your Tools.
489-
----------------------------------------
490+
Symfony: Build your App, not your Tools
491+
---------------------------------------
490492

491493
You now know that the goal of any app is to interpret each incoming request
492494
and create an appropriate response. As an application grows, it becomes more
@@ -522,24 +524,21 @@ regardless of how your project is developed. To name a few:
522524
about how that request should be handled (e.g. execute the ``contactAction()``
523525
method);
524526

525-
* `Form`_ - A full-featured and flexible framework for creating forms and
526-
handling form submissions;
527+
* `Form </components/form/introduction>` - A full-featured and flexible
528+
framework for creating forms and handling form submissions;
527529

528530
* `Validator`_ - A system for creating rules about data and then validating
529531
whether or not user-submitted data follows those rules;
530532

531-
* :doc:`ClassLoader </components/class_loader/introduction>` - An autoloading library that allows
532-
PHP classes to be used without needing to manually ``require`` the files
533-
containing those classes;
534-
535533
* :doc:`Templating </components/templating/introduction>` - A toolkit for rendering
536534
templates, handling template inheritance (i.e. a template is decorated with
537535
a layout) and performing other common template tasks;
538536

539-
* `Security`_ - A powerful library for handling all types of security inside
540-
an application;
537+
* `Security </components/security/introduction>` - A powerful library for
538+
handling all types of security inside an application;
541539

542-
* `Translation`_ - A framework for translating strings in your application.
540+
* `Translation </components/translation/introduction>` - A framework for
541+
translating strings in your application.
543542

544543
Each and every one of these components is decoupled and can be used in *any*
545544
PHP project, regardless of whether or not you use the Symfony framework.
@@ -576,8 +575,5 @@ sensible defaults. For more advanced users, the sky is the limit.
576575
.. _`List of HTTP status codes`: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
577576
.. _`List of HTTP header fields`: http://en.wikipedia.org/wiki/List_of_HTTP_header_fields
578577
.. _`List of common media types`: http://en.wikipedia.org/wiki/Internet_media_type#List_of_common_media_types
579-
.. _`Form`: https://github.com/symfony/Form
580578
.. _`Validator`: https://github.com/symfony/Validator
581-
.. _`Security`: https://github.com/symfony/Security
582-
.. _`Translation`: https://github.com/symfony/Translation
583579
.. _`Swift Mailer`: http://swiftmailer.org/

0 commit comments

Comments
 (0)