diff --git a/book/controller.rst b/book/controller.rst index ece7dc2f3c5..f80bb7d88a0 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -671,10 +671,10 @@ from any controller:: // store an attribute for reuse during a later user request $session->set('foo', 'bar'); - // in another controller for another request - $foo = $session->get('foo'); + // get the attribute set by another controller in another request + $foobar = $session->get('foobar'); - // use a default value if the key doesn't exist + // use a default value if the attribute doesn't exist $filters = $session->get('filters', array()); } diff --git a/book/routing.rst b/book/routing.rst index 0554130f241..51347dd6156 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -1316,7 +1316,9 @@ method:: $this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true); // http://www.example.com/blog/my-blog-post -From a template, it looks like this: +From a template, in Twig, simply use the ``url()`` function (which generates an absolute URL) +rather than the ``path()`` function (which generates a relative URL). In PHP, pass ``true`` +to ``generateUrl()``: .. configuration-block:: diff --git a/book/service_container.rst b/book/service_container.rst index 1dd19f0dac8..1d76ccfdcd4 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -1167,6 +1167,13 @@ By default only public services are shown, but you can also view private service $ php app/console container:debug --show-private +.. note:: + + If a private service is only used as an argument to just *one* other service, + it won't be displayed by the ``container:debug`` command, even when using + the ``--show-private`` option. See :ref:`Inline Private Services ` + for more details. + You can get more detailed information about a particular service by specifying its id: diff --git a/book/testing.rst b/book/testing.rst index 2a9408825b5..66e6b57bcec 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -89,8 +89,8 @@ of your bundle:: directory, put the test in the ``Tests/Utility/`` directory. Just like in your real application - autoloading is automatically enabled -via the ``bootstrap.php.cache`` file (as configured by default in the ``phpunit.xml.dist`` -file). +via the ``bootstrap.php.cache`` file (as configured by default in the +``app/phpunit.xml.dist`` file). Running tests for a given file or directory is also very easy: @@ -789,12 +789,12 @@ machine only. .. tip:: - Store the ``phpunit.xml.dist`` file in your code repository and ignore the - ``phpunit.xml`` file. + Store the ``app/phpunit.xml.dist`` file in your code repository and ignore + the ``app/phpunit.xml`` file. By default, only the tests from your own custom bundles stored in the standard directories ``src/*/*Bundle/Tests`` or ``src/*/Bundle/*Bundle/Tests`` are run -by the ``phpunit`` command, as configured in the ``phpunit.xml.dist`` file: +by the ``phpunit`` command, as configured in the ``app/phpunit.xml.dist`` file: .. code-block:: xml diff --git a/book/validation.rst b/book/validation.rst index 1bb3df5cf27..5c383724fdd 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -977,8 +977,8 @@ that group are valid, the second group, ``Strict``, will be validated. constraints that do not belong to any group. This means that you have to use the ``{ClassName}`` (e.g. ``User``) group - when specifing a group sequence. When using ``Default``, you get an - infinite recursion (as the ``Default`` groups references the group + when specifying a group sequence. When using ``Default``, you get an + infinite recursion (as the ``Default`` group references the group sequence, which will contain the ``Default`` group which references the same group sequence, ...). diff --git a/components/dependency_injection/advanced.rst b/components/dependency_injection/advanced.rst index 7c139a7b734..db5fa9a04b2 100644 --- a/components/dependency_injection/advanced.rst +++ b/components/dependency_injection/advanced.rst @@ -18,6 +18,8 @@ However, there are use-cases when you don't want a service to be public. This is common when a service is only defined because it could be used as an argument for another service. +.. _inlined-private-services: + .. note:: If you use a private service as an argument to only one other service,