diff --git a/book/controller.rst b/book/controller.rst
index 48369b66227..efd310c8b33 100644
--- a/book/controller.rst
+++ b/book/controller.rst
@@ -472,10 +472,13 @@ value to each variable.
object::
$httpKernel = $this->container->get('http_kernel');
- $response = $httpKernel->forward('AcmeHelloBundle:Hello:fancy', array(
- 'name' => $name,
- 'color' => 'green',
- ));
+ $response = $httpKernel->forward(
+ 'AcmeHelloBundle:Hello:fancy',
+ array(
+ 'name' => $name,
+ 'color' => 'green',
+ )
+ );
.. index::
single: Controller; Rendering templates
@@ -490,14 +493,20 @@ that's responsible for generating the HTML (or other format) for the controller.
The ``renderView()`` method renders a template and returns its content. The
content from the template can be used to create a ``Response`` object::
- $content = $this->renderView('AcmeHelloBundle:Hello:index.html.twig', array('name' => $name));
+ $content = $this->renderView(
+ 'AcmeHelloBundle:Hello:index.html.twig',
+ array('name' => $name)
+ );
return new Response($content);
This can even be done in just one step with the ``render()`` method, which
returns a ``Response`` object containing the content from the template::
- return $this->render('AcmeHelloBundle:Hello:index.html.twig', array('name' => $name));
+ return $this->render(
+ 'AcmeHelloBundle:Hello:index.html.twig',
+ array('name' => $name)
+ );
In both cases, the ``Resources/views/Hello/index.html.twig`` template inside
the ``AcmeHelloBundle`` will be rendered.
@@ -517,7 +526,10 @@ The Symfony templating engine is explained in great detail in the
service. The ``templating`` service can also be used directly::
$templating = $this->get('templating');
- $content = $templating->render('AcmeHelloBundle:Hello:index.html.twig', array('name' => $name));
+ $content = $templating->render(
+ 'AcmeHelloBundle:Hello:index.html.twig',
+ array('name' => $name)
+ );
.. note::
@@ -525,7 +537,10 @@ The Symfony templating engine is explained in great detail in the
be careful to avoid the pitfall of making your directory structure unduly
elaborate::
- $templating->render('AcmeHelloBundle:Hello/Greetings:index.html.twig', array('name' => $name));
+ $templating->render(
+ 'AcmeHelloBundle:Hello/Greetings:index.html.twig',
+ array('name' => $name)
+ );
// index.html.twig found in Resources/views/Hello/Greetings is rendered.
.. index::
diff --git a/book/doctrine.rst b/book/doctrine.rst
index 9a028e18d3d..b0f6f73c74f 100644
--- a/book/doctrine.rst
+++ b/book/doctrine.rst
@@ -472,7 +472,9 @@ on its ``id`` value::
->find($id);
if (!$product) {
- throw $this->createNotFoundException('No product found for id '.$id);
+ throw $this->createNotFoundException(
+ 'No product found for id '.$id
+ );
}
// ... do something, like pass the $product object into a template
@@ -557,7 +559,9 @@ you have a route that maps a product id to an update action in a controller::
$product = $em->getRepository('AcmeStoreBundle:Product')->find($id);
if (!$product) {
- throw $this->createNotFoundException('No product found for id '.$id);
+ throw $this->createNotFoundException(
+ 'No product found for id '.$id
+ );
}
$product->setName('New product name!');
@@ -1308,7 +1312,8 @@ and ``nullable``. Take a few examples:
/**
* A string field with length 255 that cannot be null
- * (reflecting the default values for the "type", "length" and *nullable* options)
+ * (reflecting the default values for the "type", "length"
+ * and *nullable* options)
*
* @ORM\Column()
*/
diff --git a/book/forms.rst b/book/forms.rst
index d57120857e9..37a2dacf214 100644
--- a/book/forms.rst
+++ b/book/forms.rst
@@ -1565,7 +1565,9 @@ method to specify the option::
{
$collectionConstraint = new Collection(array(
'name' => new Length(array("min" => 5)),
- 'email' => new Email(array('message' => 'Invalid email address')),
+ 'email' => new Email(
+ array('message' => 'Invalid email address')
+ ),
));
$resolver->setDefaults(array(
diff --git a/book/from_flat_php_to_symfony2.rst b/book/from_flat_php_to_symfony2.rst
index 677ab92ad38..57f2713c6ad 100644
--- a/book/from_flat_php_to_symfony2.rst
+++ b/book/from_flat_php_to_symfony2.rst
@@ -554,7 +554,10 @@ them for you. Here's the same sample application, now built in Symfony2::
->createQuery('SELECT p FROM AcmeBlogBundle:Post p')
->execute();
- return $this->render('AcmeBlogBundle:Blog:list.html.php', array('posts' => $posts));
+ return $this->render(
+ 'AcmeBlogBundle:Blog:list.html.php',
+ array('posts' => $posts)
+ );
}
public function showAction($id)
@@ -570,7 +573,10 @@ them for you. Here's the same sample application, now built in Symfony2::
throw $this->createNotFoundException();
}
- return $this->render('AcmeBlogBundle:Blog:show.html.php', array('post' => $post));
+ return $this->render(
+ 'AcmeBlogBundle:Blog:show.html.php',
+ array('post' => $post)
+ );
}
}
@@ -590,7 +596,10 @@ now quite a bit simpler:
@@ -605,7 +614,10 @@ The layout is nearly identical:
- output('title', 'Default title') ?>
+ output(
+ 'title',
+ 'Default title'
+ ) ?>
output('_content') ?>
diff --git a/book/page_creation.rst b/book/page_creation.rst
index a2f74db1f9d..e22512794b2 100644
--- a/book/page_creation.rst
+++ b/book/page_creation.rst
@@ -288,10 +288,16 @@ of writing the HTML inside the controller, render a template instead:
{
public function indexAction($name)
{
- return $this->render('AcmeHelloBundle:Hello:index.html.twig', array('name' => $name));
+ return $this->render(
+ 'AcmeHelloBundle:Hello:index.html.twig',
+ array('name' => $name)
+ );
// render a PHP template instead
- // return $this->render('AcmeHelloBundle:Hello:index.html.php', array('name' => $name));
+ // return $this->render(
+ // 'AcmeHelloBundle:Hello:index.html.php',
+ // array('name' => $name)
+ // );
}
}
@@ -903,7 +909,9 @@ file of your choice::
// app/AppKernel.php
public function registerContainerConfiguration(LoaderInterface $loader)
{
- $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
+ $loader->load(
+ __DIR__.'/config/config_'.$this->getEnvironment().'.yml'
+ );
}
You already know that the ``.yml`` extension can be changed to ``.xml`` or
diff --git a/book/propel.rst b/book/propel.rst
index 95fe1cd9871..612257e0ac4 100644
--- a/book/propel.rst
+++ b/book/propel.rst
@@ -181,7 +181,9 @@ value::
->findPk($id);
if (!$product) {
- throw $this->createNotFoundException('No product found for id '.$id);
+ throw $this->createNotFoundException(
+ 'No product found for id '.$id
+ );
}
// ... do something, like pass the $product object into a template
@@ -202,7 +204,9 @@ have a route that maps a product id to an update action in a controller::
->findPk($id);
if (!$product) {
- throw $this->createNotFoundException('No product found for id '.$id);
+ throw $this->createNotFoundException(
+ 'No product found for id '.$id
+ );
}
$product->setName('New product name!');
diff --git a/book/routing.rst b/book/routing.rst
index 1bdb00d0fcd..117ad48a8c7 100644
--- a/book/routing.rst
+++ b/book/routing.rst
@@ -417,7 +417,7 @@ match, giving the ``page`` parameter a value of ``2``. Perfect.
.. tip::
- Routes with optional parameters at the end will not match on requests
+ Routes with optional parameters at the end will not match on requests
with a trailing slash (i.e. ``/blog/`` will not match, ``/blog`` will match).
.. index::
@@ -1090,7 +1090,10 @@ a route+parameters back to a URL. The
system. Take the ``blog_show`` example route from earlier::
$params = $router->match('/blog/my-blog-post');
- // array('slug' => 'my-blog-post', '_controller' => 'AcmeBlogBundle:Blog:show')
+ // array(
+ // 'slug' => 'my-blog-post',
+ // '_controller' => 'AcmeBlogBundle:Blog:show',
+ // )
$uri = $router->generate('blog_show', array('slug' => 'my-blog-post'));
// /blog/my-blog-post
@@ -1103,9 +1106,12 @@ that route. With this information, any URL can easily be generated::
{
public function showAction($slug)
{
- // ...
+ // ...
- $url = $this->get('router')->generate('blog_show', array('slug' => 'my-blog-post'));
+ $url = $this->get('router')->generate(
+ 'blog_show',
+ array('slug' => 'my-blog-post')
+ );
}
}
@@ -1119,7 +1125,10 @@ In an upcoming section, you'll learn how to generate URLs from inside templates.
.. code-block:: javascript
- var url = Routing.generate('blog_show', { "slug": 'my-blog-post'});
+ var url = Routing.generate(
+ 'blog_show',
+ {"slug": 'my-blog-post'}
+ );
For more information, see the documentation for that bundle.
diff --git a/book/security.rst b/book/security.rst
index 65941b63f28..9de8d09c14d 100644
--- a/book/security.rst
+++ b/book/security.rst
@@ -434,17 +434,22 @@ Next, create the controller that will display the login form::
// get the login error if there is one
if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
- $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
+ $error = $request->attributes->get(
+ SecurityContext::AUTHENTICATION_ERROR
+ );
} else {
$error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
$session->remove(SecurityContext::AUTHENTICATION_ERROR);
}
- return $this->render('AcmeSecurityBundle:Security:login.html.twig', array(
- // last username entered by the user
- 'last_username' => $session->get(SecurityContext::LAST_USERNAME),
- 'error' => $error,
- ));
+ return $this->render(
+ 'AcmeSecurityBundle:Security:login.html.twig',
+ array(
+ // last username entered by the user
+ 'last_username' => $session->get(SecurityContext::LAST_USERNAME),
+ 'error' => $error,
+ )
+ );
}
}
diff --git a/book/service_container.rst b/book/service_container.rst
index 224fda19b56..1fb138c285b 100644
--- a/book/service_container.rst
+++ b/book/service_container.rst
@@ -565,10 +565,14 @@ something like this::
Without using the service container, you can create a new ``NewsletterManager``
fairly easily from inside a controller::
+ use Acme\HelloBundle\Newsletter\NewsletterManager;
+
+ // ...
+
public function sendNewsletterAction()
{
$mailer = $this->get('my_mailer');
- $newsletter = new Acme\HelloBundle\Newsletter\NewsletterManager($mailer);
+ $newsletter = new NewsletterManager($mailer);
// ...
}
@@ -618,7 +622,10 @@ the service container gives you a much more appealing option:
use Symfony\Component\DependencyInjection\Reference;
// ...
- $container->setParameter('newsletter_manager.class', 'Acme\HelloBundle\Newsletter\NewsletterManager');
+ $container->setParameter(
+ 'newsletter_manager.class',
+ 'Acme\HelloBundle\Newsletter\NewsletterManager'
+ );
$container->setDefinition('my_mailer', ...);
$container->setDefinition('newsletter_manager', new Definition(
@@ -708,7 +715,10 @@ Injecting the dependency by the setter method just needs a change of syntax:
use Symfony\Component\DependencyInjection\Reference;
// ...
- $container->setParameter('newsletter_manager.class', 'Acme\HelloBundle\Newsletter\NewsletterManager');
+ $container->setParameter(
+ 'newsletter_manager.class',
+ 'Acme\HelloBundle\Newsletter\NewsletterManager'
+ );
$container->setDefinition('my_mailer', ...);
$container->setDefinition('newsletter_manager', new Definition(
@@ -767,12 +777,18 @@ it exists and do nothing if it doesn't:
use Symfony\Component\DependencyInjection\ContainerInterface;
// ...
- $container->setParameter('newsletter_manager.class', 'Acme\HelloBundle\Newsletter\NewsletterManager');
+ $container->setParameter(
+ 'newsletter_manager.class',
+ 'Acme\HelloBundle\Newsletter\NewsletterManager'
+ );
$container->setDefinition('my_mailer', ...);
$container->setDefinition('newsletter_manager', new Definition(
'%newsletter_manager.class%',
- array(new Reference('my_mailer', ContainerInterface::IGNORE_ON_INVALID_REFERENCE))
+ array(new Reference(
+ 'my_mailer',
+ ContainerInterface::IGNORE_ON_INVALID_REFERENCE
+ ))
));
In YAML, the special ``@?`` syntax tells the service container that the dependency
diff --git a/book/templating.rst b/book/templating.rst
index 38818b6901c..5db7295eae4 100644
--- a/book/templating.rst
+++ b/book/templating.rst
@@ -532,7 +532,9 @@ Including this template from any other template is simple:
Recent Articles
{% for article in articles %}
- {% include 'AcmeArticleBundle:Article:articleDetails.html.twig' with {'article': article} %}
+ {% include 'AcmeArticleBundle:Article:articleDetails.html.twig'
+ with {'article': article}
+ %}
{% endfor %}
{% endblock %}
@@ -582,10 +584,14 @@ articles::
{
public function recentArticlesAction($max = 3)
{
- // make a database call or other logic to get the "$max" most recent articles
+ // make a database call or other logic
+ // to get the "$max" most recent articles
$articles = ...;
- return $this->render('AcmeArticleBundle:Article:recentList.html.twig', array('articles' => $articles));
+ return $this->render(
+ 'AcmeArticleBundle:Article:recentList.html.twig',
+ array('articles' => $articles)
+ );
}
}
@@ -815,7 +821,11 @@ correctly:
.. code-block:: html+php
- Home
+ Home
.. index::
single: Templating; Linking to assets
@@ -1062,7 +1072,10 @@ customize the markup specifically for your application. By digging into the
// some logic to retrieve the blogs
$blogs = ...;
- $this->render('AcmeBlogBundle:Blog:index.html.twig', array('blogs' => $blogs));
+ $this->render(
+ 'AcmeBlogBundle:Blog:index.html.twig',
+ array('blogs' => $blogs)
+ );
}
When the ``AcmeBlogBundle:Blog:index.html.twig`` is rendered, Symfony2 actually
diff --git a/book/testing.rst b/book/testing.rst
index 35b1528a673..c9a679c3a34 100644
--- a/book/testing.rst
+++ b/book/testing.rst
@@ -145,7 +145,10 @@ for its ``DemoController`` (`DemoControllerTest`_) that reads as follows::
$crawler = $client->request('GET', '/demo/hello/Fabien');
- $this->assertGreaterThan(0, $crawler->filter('html:contains("Hello Fabien")')->count());
+ $this->assertGreaterThan(
+ 0,
+ $crawler->filter('html:contains("Hello Fabien")')->count()
+ );
}
}
@@ -217,7 +220,10 @@ Or, test against the Response content directly if you just want to assert that
the content contains some text, or if the Response is not an XML/HTML
document::
- $this->assertRegExp('/Hello Fabien/', $client->getResponse()->getContent());
+ $this->assertRegExp(
+ '/Hello Fabien/',
+ $client->getResponse()->getContent()
+ );
.. _book-testing-request-method-sidebar:
@@ -260,14 +266,23 @@ document::
To get you started faster, here is a list of the most common and
useful test assertions::
- // Assert that there is at least one h2 tag with the class "subtitle"
- $this->assertGreaterThan(0, $crawler->filter('h2.subtitle')->count());
+ // Assert that there is at least one h2 tag
+ // with the class "subtitle"
+ $this->assertGreaterThan(
+ 0,
+ $crawler->filter('h2.subtitle')->count()
+ );
// Assert that there are exactly 4 h2 tags on the page
$this->assertCount(4, $crawler->filter('h2'));
// Assert that the "Content-Type" header is "application/json"
- $this->assertTrue($client->getResponse()->headers->contains('Content-Type', 'application/json'));
+ $this->assertTrue(
+ $client->getResponse()->headers->contains(
+ 'Content-Type',
+ 'application/json'
+ )
+ );
// Assert that the response content matches a regexp.
$this->assertRegExp('/foo/', $client->getResponse()->getContent());
@@ -277,10 +292,15 @@ document::
// Assert that the response status code is 404
$this->assertTrue($client->getResponse()->isNotFound());
// Assert a specific 200 status code
- $this->assertEquals(200, $client->getResponse()->getStatusCode());
+ $this->assertEquals(
+ 200,
+ $client->getResponse()->getStatusCode()
+ );
// Assert that the response is a redirect to /demo/contact
- $this->assertTrue($client->getResponse()->isRedirect('/demo/contact'));
+ $this->assertTrue(
+ $client->getResponse()->isRedirect('/demo/contact')
+ );
// or simply check that the response is a redirect to any URL
$this->assertTrue($client->getResponse()->isRedirect());
@@ -524,8 +544,10 @@ The Crawler can extract information from the nodes::
// Returns the node value for the first node
$crawler->text();
- // Extracts an array of attributes for all nodes (_text returns the node value)
- // returns an array for each element in crawler, each with the value and href
+ // Extracts an array of attributes for all nodes
+ // (_text returns the node value)
+ // returns an array for each element in crawler,
+ // each with the value and href
$info = $crawler->extract(array('_text', 'href'));
// Executes a lambda for each node and return an array of results
diff --git a/book/translation.rst b/book/translation.rst
index 174d5bb25b2..fc6ded5690b 100644
--- a/book/translation.rst
+++ b/book/translation.rst
@@ -14,7 +14,8 @@ the user::
// text will *always* print out in English
echo 'Hello World';
- // text can be translated into the end-user's language or default to English
+ // text can be translated into the end-user's language or
+ // default to English
echo $translator->trans('Hello World');
.. note::
@@ -185,7 +186,10 @@ variable with a "placeholder"::
public function indexAction($name)
{
- $t = $this->get('translator')->trans('Hello %name%', array('%name%' => $name));
+ $t = $this->get('translator')->trans(
+ 'Hello %name%',
+ array('%name%' => $name)
+ );
new Response($t);
}
@@ -613,7 +617,15 @@ Message pluralization is a tough topic as the rules can be quite complex. For
instance, here is the mathematic representation of the Russian pluralization
rules::
- (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
+ (($number % 10 == 1) && ($number % 100 != 11))
+ ? 0
+ : ((($number % 10 >= 2)
+ && ($number % 10 <= 4)
+ && (($number % 100 < 10)
+ || ($number % 100 >= 20)))
+ ? 1
+ : 2
+ );
As you can see, in Russian, you can have three different plural forms, each
given an index of 0, 1 or 2. For each form, the plural is different, and
diff --git a/book/validation.rst b/book/validation.rst
index 721cf8a1875..9565bd272de 100644
--- a/book/validation.rst
+++ b/book/validation.rst
@@ -8,10 +8,10 @@ Validation is a very common task in web applications. Data entered in forms
needs to be validated. Data also needs to be validated before it is written
into a database or passed to a web service.
-Symfony2 ships with a `Validator`_ component that makes this task easy and
-transparent. This component is based on the
-`JSR303 Bean Validation specification`_. What? A Java specification in PHP?
-You heard right, but it's not as bad as it sounds. Let's look at how it
+Symfony2 ships with a `Validator`_ component that makes this task easy and
+transparent. This component is based on the
+`JSR303 Bean Validation specification`_. What? A Java specification in PHP?
+You heard right, but it's not as bad as it sounds. Let's look at how it
can be used in PHP.
.. index::
@@ -450,7 +450,10 @@ options can be specified in this way.
public static function loadValidatorMetadata(ClassMetadata $metadata)
{
- $metadata->addPropertyConstraint('gender', new Choice(array('male', 'female')));
+ $metadata->addPropertyConstraint(
+ 'gender',
+ new Choice(array('male', 'female'))
+ );
}
}
@@ -813,17 +816,20 @@ it looks like this::
$emailConstraint->message = 'Invalid email address';
// use the validator to validate the value
- $errorList = $this->get('validator')->validateValue($email, $emailConstraint);
+ $errorList = $this->get('validator')->validateValue(
+ $email,
+ $emailConstraint
+ );
if (count($errorList) == 0) {
// this IS a valid email address, do something
} else {
// this is *not* a valid email address
$errorMessage = $errorList[0]->getMessage()
-
+
// ... do something with the error
}
-
+
// ...
}
diff --git a/cookbook/assetic/asset_management.rst b/cookbook/assetic/asset_management.rst
index c541be4ac64..660ba8e902a 100644
--- a/cookbook/assetic/asset_management.rst
+++ b/cookbook/assetic/asset_management.rst
@@ -64,14 +64,14 @@ drawn from various sources such as from within a bundle:
.. code-block:: html+jinja
- {% stylesheets '@AcmeFooBundle/Resources/public/css/*' %}
+ {% stylesheets 'bundles/acme_foo/css/*' %}
{% endstylesheets %}
.. code-block:: html+php
stylesheets(
- array('@AcmeFooBundle/Resources/public/css/*')
+ array('bundles/acme_foo/css/*')
) as $url): ?>
diff --git a/cookbook/console/console_command.rst b/cookbook/console/console_command.rst
index dc6cbd95647..5f22843621c 100644
--- a/cookbook/console/console_command.rst
+++ b/cookbook/console/console_command.rst
@@ -62,6 +62,26 @@ This command will now automatically be available to run:
$ app/console demo:greet Fabien
+Getting Services from the Service Container
+-------------------------------------------
+
+By using :class:`Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand`
+as the base class for the command (instead of the more basic
+:class:`Symfony\\Component\\Console\\Command\\Command`), you have access to the
+service container. In other words, you have access to any configured service.
+For example, you could easily extend the task to be translatable::
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $name = $input->getArgument('name');
+ $translator = $this->getContainer()->get('translator');
+ if ($name) {
+ $output->writeln($translator->trans('Hello %name%!', array('%name%' => $name)));
+ } else {
+ $output->writeln($translator->trans('Hello!'));
+ }
+ }
+
Testing Commands
----------------
@@ -90,22 +110,31 @@ should be used instead of :class:`Symfony\\Component\\Console\\Application`::
}
}
-Getting Services from the Service Container
--------------------------------------------
+To be able to use the fully set up service container for your console tests
+you can extend your test from
+:class:`Symfony\Bundle\FrameworkBundle\Test\WebTestCase`::
-By using :class:`Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand`
-as the base class for the command (instead of the more basic
-:class:`Symfony\\Component\\Console\\Command\\Command`), you have access to the
-service container. In other words, you have access to any configured service.
-For example, you could easily extend the task to be translatable::
+ use Symfony\Component\Console\Tester\CommandTester;
+ use Symfony\Bundle\FrameworkBundle\Console\Application;
+ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
+ use Acme\DemoBundle\Command\GreetCommand;
- protected function execute(InputInterface $input, OutputInterface $output)
+ class ListCommandTest extends WebTestCase
{
- $name = $input->getArgument('name');
- $translator = $this->getContainer()->get('translator');
- if ($name) {
- $output->writeln($translator->trans('Hello %name%!', array('%name%' => $name)));
- } else {
- $output->writeln($translator->trans('Hello!'));
+ public function testExecute()
+ {
+ $kernel = $this->createKernel();
+ $kernel->boot();
+
+ $application = new Application($kernel);
+ $application->add(new GreetCommand());
+
+ $command = $application->find('demo:greet');
+ $commandTester = new CommandTester($command);
+ $commandTester->execute(array('command' => $command->getName()));
+
+ $this->assertRegExp('/.../', $commandTester->getDisplay());
+
+ // ...
}
}
diff --git a/cookbook/deployment-tools.rst b/cookbook/deployment-tools.rst
index 999b1502d62..a8a1179928c 100644
--- a/cookbook/deployment-tools.rst
+++ b/cookbook/deployment-tools.rst
@@ -1,8 +1,8 @@
.. index::
single: Deployment
-Deploying a Symfony2 Application
-================================
+How to deploy a Symfony2 application
+====================================
.. note::
@@ -189,4 +189,4 @@ Platform as a Service Providers:
.. _`bundles that add deployment features`: http://knpbundles.com/search?q=deploy
.. _`Symfony IRC channel`: http://webchat.freenode.net/?channels=symfony
.. _`Memcached`: http://memcached.org/
-.. _`Redis`: http://redis.io/
\ No newline at end of file
+.. _`Redis`: http://redis.io/
diff --git a/cookbook/map.rst.inc b/cookbook/map.rst.inc
index dd85d5a0fb6..f102890e11d 100644
--- a/cookbook/map.rst.inc
+++ b/cookbook/map.rst.inc
@@ -24,7 +24,7 @@
* :doc:`/cookbook/configuration/pdo_session_storage`
* :doc:`/cookbook/configuration/apache_router`
-* **Console Commands**
+* :doc:`/cookbook/console/index`
* :doc:`/cookbook/console/console_command`
* :doc:`/cookbook/console/usage`
@@ -39,6 +39,10 @@
* :doc:`/cookbook/debugging`
+* **Deployment**
+
+* :doc:`/cookbook/deployment-tools`
+
* :doc:`/cookbook/doctrine/index`
* :doc:`/cookbook/doctrine/file_uploads`
@@ -99,16 +103,6 @@
* :doc:`/cookbook/routing/method_parameters`
* :doc:`/cookbook/routing/service_container_parameters`
-* **symfony1**
-
- * :doc:`/cookbook/symfony1`
-
-* :doc:`/cookbook/service_container/index`
-
- * :doc:`/cookbook/service_container/event_listener`
- * :doc:`/cookbook/service_container/scopes`
- * :doc:`/cookbook/service_container/compiler_passes`
-
* :doc:`/cookbook/security/index`
* :doc:`/cookbook/security/entity_provider`
@@ -123,6 +117,16 @@
* :doc:`/cookbook/security/custom_authentication_provider`
* :doc:`/cookbook/security/target_path`
+* :doc:`/cookbook/service_container/index`
+
+ * :doc:`/cookbook/service_container/event_listener`
+ * :doc:`/cookbook/service_container/scopes`
+ * :doc:`/cookbook/service_container/compiler_passes`
+
+* **symfony1**
+
+ * :doc:`/cookbook/symfony1`
+
* :doc:`/cookbook/templating/index`
* :doc:`/cookbook/templating/global_variables`
@@ -150,4 +154,3 @@
* :doc:`/cookbook/workflow/new_project_git`
* :doc:`/cookbook/workflow/new_project_svn`
-* :doc:`/cookbook/deployment-tools`
diff --git a/cookbook/security/acl.rst b/cookbook/security/acl.rst
index 39d167b8a87..d83ed37319a 100644
--- a/cookbook/security/acl.rst
+++ b/cookbook/security/acl.rst
@@ -105,7 +105,7 @@ Creating an ACL, and adding an ACE
// ... setup $form, and bind data
if ($form->isValid()) {
- $entityManager = $this->get('doctrine.orm.default_entity_manager');
+ $entityManager = $this->getDoctrine()->getEntityManager();
$entityManager->persist($comment);
$entityManager->flush();