diff --git a/guides/cache/http.rst b/guides/cache/http.rst index cbff428df45..d1fe128bf32 100644 --- a/guides/cache/http.rst +++ b/guides/cache/http.rst @@ -307,8 +307,8 @@ does exactly that by exposing a simple and efficient pattern:: // create a Response with a ETag and/or a Last-Modified header $response = new Response(); - $response->setETag($post->computeETag()); - $response->setLastModified($post->getPublishedAt()); + $response->setETag($article->computeETag()); + $response->setLastModified($article->getPublishedAt()); // Check that the Response is not modified for the given Request if ($response->isNotModified($request)) { @@ -364,10 +364,10 @@ The Response class provides many more methods related to the cache. Here are the most useful ones:: // Mark the Response as private - $response->setPrivate(true); + $response->setPrivate(); // Mark the Response as public - $response->setPublic(true); + $response->setPublic(); // Marks the Response stale $response->expire(); @@ -434,9 +434,11 @@ caching:: require_once __DIR__.'/../app/AppCache.php'; + use Symfony\Component\HttpFoundation\Request; + // wrap the default AppKernel with the AppCache one $kernel = new AppCache(new AppKernel('prod', false)); - $kernel->handle()->send(); + $kernel->handle(new Request())->send(); .. tip:: @@ -451,7 +453,7 @@ finely tuned via a set of options you can set by overriding the ``getOptions()`` method:: // app/AppCache.php - class BlogCache extends Cache + class AppCache extends Cache { protected function getOptions() { diff --git a/guides/emails.rst b/guides/emails.rst index e10ca06cd4a..467278c21ea 100644 --- a/guides/emails.rst +++ b/guides/emails.rst @@ -59,7 +59,7 @@ The only mandatory configuration parameter is ``transport``: .. code-block:: php // app/config/config.php - $container->loadFromExtension('swift', 'mailer', array( + $container->loadFromExtension('swiftmailer', 'config', array( 'transport' => "smtp", 'encryption' => "ssl", 'auth_mode' => "login", diff --git a/guides/validator/validation.rst b/guides/validator/validation.rst index 1ed512f4d4c..2e19c66161d 100644 --- a/guides/validator/validation.rst +++ b/guides/validator/validation.rst @@ -19,7 +19,7 @@ objects: .. code-block:: php - $validator = $container->getService('validator'); + $validator = $container->get('validator'); $author = new Author(); print $validator->validate($author); diff --git a/quick_tour/the_architecture.rst b/quick_tour/the_architecture.rst index d40ef6525c1..090e5d94346 100644 --- a/quick_tour/the_architecture.rst +++ b/quick_tour/the_architecture.rst @@ -136,6 +136,7 @@ method of the ``AppKernel`` class:: { $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), + new Symfony\Bundle\TwigBundle\TwigBundle(), // enable third-party bundles new Symfony\Bundle\ZendBundle\ZendBundle(), @@ -143,7 +144,6 @@ method of the ``AppKernel`` class:: new Symfony\Bundle\DoctrineBundle\DoctrineBundle(), //new Symfony\Bundle\DoctrineMigrationsBundle\DoctrineMigrationsBundle(), //new Symfony\Bundle\DoctrineMongoDBBundle\DoctrineMongoDBBundle(), - //new Symfony\Bundle\TwigBundle\TwigBundle(), // register your bundles new Application\HelloBundle\HelloBundle(), @@ -329,7 +329,7 @@ specific configuration file: .. code-block:: php - // app/config/config.php + // app/config/config_dev.php $loader->import('config.php'); $container->loadFromExtension('app', 'config', array(