@@ -11,7 +11,7 @@ better software than with flat PHP, you'll see for yourself.
11
11
In this chapter, you'll write a simple application in flat PHP, and then
12
12
refactor it to be more organized. You'll travel through time, seeing the
13
13
decisions behind why web development has evolved over the past several years
14
- to where it is now.
14
+ to where it is now.
15
15
16
16
By the end, you'll see how Symfony2 can rescue you from mundane tasks and
17
17
let you take back control of your code.
@@ -132,7 +132,7 @@ to the area of *your* code that processes user input and prepares the response.
132
132
In this case, our controller prepares data from the database and then includes
133
133
a template to present that data. With the controller isolated, you could
134
134
easily change *just * the template file if you needed to render the blog
135
- entries in some other format (e.g. ``list.json.php `` for JSON format).
135
+ entries in some other format (e.g. ``list.json.php `` for JSON format).
136
136
137
137
Isolating the Application (Domain) Logic
138
138
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -424,7 +424,7 @@ an autoloader that Symfony provides. An autoloader is a tool that makes it
424
424
possible to start using PHP classes without explicitly including the file
425
425
containing the class.
426
426
427
- First, `download symfony `_ and place it into a ``vendor/symfony/ `` directory.
427
+ First, `download symfony `_ and place it into a ``vendor/symfony/symfony/ `` directory.
428
428
Next, create an ``app/bootstrap.php `` file. Use it to ``require `` the two
429
429
files in the application and to configure the autoloader:
430
430
@@ -434,11 +434,11 @@ files in the application and to configure the autoloader:
434
434
// bootstrap.php
435
435
require_once 'model.php';
436
436
require_once 'controllers.php';
437
- require_once 'vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
437
+ require_once 'vendor/symfony/symfony/ src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
438
438
439
439
$loader = new Symfony\C omponent\C lassLoader\U niversalClassLoader();
440
440
$loader->registerNamespaces(array(
441
- 'Symfony' => __DIR__.'/../vendor/symfony/src',
441
+ 'Symfony' => __DIR__.'/../vendor/symfony/symfony/ src',
442
442
));
443
443
444
444
$loader->register();
@@ -564,7 +564,7 @@ them for you. Here's the same sample application, now built in Symfony2:
564
564
->getEntityManager()
565
565
->getRepository('AcmeBlogBundle:Post')
566
566
->find($id);
567
-
567
+
568
568
if (!$post) {
569
569
// cause the 404 page not found to be displayed
570
570
throw $this->createNotFoundException();
@@ -581,7 +581,7 @@ now quite a bit simpler:
581
581
582
582
.. code-block :: html+php
583
583
584
- <!-- src/Acme/BlogBundle/Resources/views/Blog/list.html.php -->
584
+ <!-- src/Acme/BlogBundle/Resources/views/Blog/list.html.php -->
585
585
<?php $view->extend('::layout.html.php') ?>
586
586
587
587
<?php $view['slots']->set('title', 'List of Posts') ?>
0 commit comments