Skip to content

Commit 6b6cbc0

Browse files
committed
WIP
1 parent da1759a commit 6b6cbc0

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

book/page_creation.rst

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,26 @@
22
single: Page creation
33

44
.. _creating-pages-in-symfony2:
5+
.. _creating-pages-in-symfony:
56

6-
Creating Pages in Symfony
7-
=========================
7+
Create your First Page in Symfony
8+
=================================
89

9-
Creating a new page in Symfony is a simple two-step process:
10+
Creating a new page - whether it's an HTML page or a JSON endpoint - is a
11+
simple two-step process:
1012

11-
* *Create a route*: A route defines the URL (e.g. ``/about``) to your page
12-
and specifies a controller (which is a PHP function) that Symfony should
13-
execute when the URL of an incoming request matches the route path;
13+
#. *Create a route*: A route is the URL (e.g. ``/about``) to your page and
14+
points to a controller;
1415

15-
* *Create a controller*: A controller is a PHP function that takes the incoming
16-
request and transforms it into the Symfony ``Response`` object that's
17-
returned to the user.
16+
#. *Create a controller*: A controller is the function you write that builds
17+
the page. You take the incoming request information and use it to create
18+
a Symfony ``Response``, which could hold HTML content, a JSON string or
19+
anything else.
1820

19-
This simple approach is beautiful because it matches the way that the Web works.
20-
Every interaction on the Web is initiated by an HTTP request. The job of
21-
your application is simply to interpret the request and return the appropriate
21+
Just like on the web, every interaction is initiated by an HTTP request.
22+
Your job is pure and simple: understand that request and return the appropriate
2223
HTTP response.
2324

24-
Symfony follows this philosophy and provides you with tools and conventions
25-
to keep your application organized as it grows in users and complexity.
26-
2725
.. index::
2826
single: Page creation; Environments & Front Controllers
2927

0 commit comments

Comments
 (0)