Skip to content

Commit 77f94d7

Browse files
committed
Removed "Stay Organized"
1 parent 0846e68 commit 77f94d7

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

http_fundamentals.rst

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -329,41 +329,14 @@ and the routing of different URLs to different parts of your application
329329
is done internally. This solves both problems with the original approach.
330330
Almost all modern web apps do this.
331331

332-
Stay Organized
333-
~~~~~~~~~~~~~~
334-
335-
Inside your front controller, you have to figure out which code should be
336-
executed and what the content to return should be. To figure this out, you'll
337-
need to check the incoming URI and execute different parts of your code depending
338-
on that value. This can get ugly quickly::
339-
340-
// index.php
341-
use Symfony\Component\HttpFoundation\Request;
342-
use Symfony\Component\HttpFoundation\Response;
343-
344-
$request = Request::createFromGlobals();
345-
$path = $request->getPathInfo(); // the URI path being requested
346-
347-
if (in_array($path, array('', '/'))) {
348-
$response = new Response('Welcome to the homepage.');
349-
} elseif ('/contact' === $path) {
350-
$response = new Response('Contact us');
351-
} else {
352-
$response = new Response('Page not found.', Response::HTTP_NOT_FOUND);
353-
}
354-
$response->send();
355-
356-
Solving this problem can be difficult. Fortunately it's *exactly* what Symfony
357-
is designed to do.
358-
359332
.. index::
360333
single: HTTP; Symfony request flow
361334

362335
The Symfony Application Flow
363336
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
364337

365-
When you let Symfony handle each request, life is much easier. Symfony follows
366-
the same simple pattern for every request:
338+
Symfony will operate in this front-controller file to handle each incoming
339+
request. Symfony follows the same simple pattern for every request:
367340

368341
.. _request-flow-figure:
369342

0 commit comments

Comments
 (0)