Skip to content
Browse files

Merge branch '2.0' into 2.1

Conflicts:
	book/controller.rst
	book/forms.rst
	cookbook/map.rst.inc
  • Loading branch information...
2 parents ee3dfbd + 46ed478 commit 7456e3ed737502243ccd04a746db1d6080c8a0be @weaverryan weaverryan committed
View
31 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::
View
11 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()
*/
View
4 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(
View
20 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:
<ul>
<?php foreach ($posts as $post): ?>
<li>
- <a href="<?php echo $view['router']->generate('blog_show', array('id' => $post->getId())) ?>">
+ <a href="<?php echo $view['router']->generate(
+ 'blog_show',
+ array('id' => $post->getId())
+ ) ?>">
<?php echo $post->getTitle() ?>
</a>
</li>
@@ -605,7 +614,10 @@ The layout is nearly identical:
<!DOCTYPE html>
<html>
<head>
- <title><?php echo $view['slots']->output('title', 'Default title') ?></title>
+ <title><?php echo $view['slots']->output(
+ 'title',
+ 'Default title'
+ ) ?></title>
</head>
<body>
<?php echo $view['slots']->output('_content') ?>
View
14 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
View
8 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!');
View
19 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.
View
17 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,
+ )
+ );
}
}
View
26 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
View
23 book/templating.rst
@@ -532,7 +532,9 @@ Including this template from any other template is simple:
<h1>Recent Articles<h1>
{% 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
- <a href="<?php echo $view['router']->generate('_welcome', array(), true) ?>">Home</a>
+ <a href="<?php echo $view['router']->generate(
+ '_welcome',
+ array(),
+ true
+ ) ?>">Home</a>
.. 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
View
40 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
View
18 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
View
22 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
}
-
+
// ...
}
View
4 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/*' %}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
.. code-block:: html+php
<?php foreach ($view['assetic']->stylesheets(
- array('@AcmeFooBundle/Resources/public/css/*')
+ array('bundles/acme_foo/css/*')
) as $url): ?>
<link rel="stylesheet" href="<?php echo $view->escape($url) ?>" />
<?php endforeach; ?>
View
57 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());
+
+ // ...
}
}
View
6 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/
+.. _`Redis`: http://redis.io/
View
27 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`
View
2 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();

0 comments on commit 7456e3e

Please sign in to comment.
Something went wrong with that request. Please try again.