@@ -279,17 +279,16 @@ and create the appropriate response based on your application logic*.
279
279
The Journey from the Request to the Response
280
280
--------------------------------------------
281
281
282
- Like HTTP itself, the ``Request `` and ``Response `` objects are pretty simple.
283
- The hard part of building an application is writing what comes in between.
284
- In other words, the real work comes in writing the code that interprets the
285
- request information and creates the response.
282
+ Like HTTP itself, using the ``Request `` and ``Response `` objects is pretty
283
+ simple. The hard part of building an application is writing what comes in
284
+ between. In other words, the real work comes in writing the code that
285
+ interprets the request information and creates the response.
286
286
287
287
Your application probably does many things, like sending emails, handling
288
288
form submissions, saving things to a database, rendering HTML pages and protecting
289
289
content with security. How can you manage all of this and still keep your
290
- code organized and maintainable?
291
-
292
- Symfony was created to solve these problems so that you don't have to.
290
+ code organized and maintainable? Symfony was created to help you with these
291
+ problems.
293
292
294
293
.. index ::
295
294
single: Front controller; Origins
@@ -298,13 +297,7 @@ The Front Controller
298
297
~~~~~~~~~~~~~~~~~~~~
299
298
300
299
Traditionally, applications were built so that each "page" of a site was
301
- its own physical file:
302
-
303
- .. code-block :: text
304
-
305
- index.php
306
- contact.php
307
- blog.php
300
+ its own physical file (e.g. ``index.php ``, ``contact.php ``, etc.).
308
301
309
302
There are several problems with this approach, including the inflexibility
310
303
of the URLs (what if you wanted to change ``blog.php `` to ``news.php `` without
@@ -325,14 +318,16 @@ handles every request coming into your application. For example:
325
318
326
319
.. tip ::
327
320
328
- By using rewrite rules in your :doc: `web server configuration </cookbook/configuration/web_server_configuration >`,
329
- the ``index.php `` won't be needed and you will have beautiful, clean URLs (e.g. ``/show ``).
321
+ By using rewrite rules in your
322
+ :doc: `web server configuration </cookbook/configuration/web_server_configuration >`,
323
+ the ``index.php `` won't be needed and you will have beautiful, clean URLs
324
+ (e.g. ``/show ``).
330
325
331
326
Now, every request is handled exactly the same way. Instead of individual URLs
332
327
executing different PHP files, the front controller is *always * executed,
333
328
and the routing of different URLs to different parts of your application
334
329
is done internally. This solves both problems with the original approach.
335
- Almost all modern web apps do this - including apps like WordPress .
330
+ Almost all modern web apps do this.
336
331
337
332
Stay Organized
338
333
~~~~~~~~~~~~~~
0 commit comments