8000 Update code and fix typo by blue-eyes · Pull Request #56 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Update code and fix typo #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions guides/cache/http.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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::

Expand All @@ -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()
{
Expand Down
2 changes: 1 addition & 1 deletion guides/emails.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion guides/validator/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ objects:

.. code-block:: php

$validator = $container->getService('validator');
$validator = $container->get('validator');
$author = new Author();

print $validator->validate($author);
Expand Down
4 changes: 2 additions & 2 deletions quick_tour/the_architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ 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(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
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(),
Expand Down Expand Up @@ -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(
Expand Down
0