Skip to content

Commit 00ab55b

Browse files
committed
Merge branch '2.3' into 2.6
Conflicts: book/controller.rst
2 parents 6f576de + 0dc6204 commit 00ab55b

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

best_practices/creating-the-project.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ ProductBundle, InvoiceBundle, etc.
9494

9595
But a bundle is *meant* to be something that can be reused as a stand-alone
9696
piece of software. If UserBundle cannot be used *"as is"* in other Symfony
97-
apps, then it shouldn't be its own bundle. Moreover InvoiceBundle depends on
97+
apps, then it shouldn't be its own bundle. Moreover, if InvoiceBundle depends on
9898
ProductBundle, then there's no advantage to having two separate bundles.
9999

100100
.. best-practice::

book/controller.rst

+7-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Controller
55
==========
66

77
A controller is a PHP callable you create that takes information from the
8-
HTTP request and constructs and returns an HTTP response (as a Symfony
8+
HTTP request and creates and returns an HTTP response (as a Symfony
99
``Response`` object). The response could be an HTML page, an XML document,
1010
a serialized JSON array, an image, a redirect, a 404 error or anything else
1111
you can dream up. The controller contains whatever arbitrary logic *your
@@ -34,7 +34,7 @@ common examples:
3434
for the homepage of the site.
3535

3636
* *Controller B* reads the ``slug`` parameter from the request to load a
37-
blog entry from the database and create a ``Response`` object displaying
37+
blog entry from the database and creates a ``Response`` object displaying
3838
that blog. If the ``slug`` can't be found in the database, it creates and
3939
returns a ``Response`` object with a 404 status code.
4040

@@ -201,7 +201,7 @@ to the controller:
201201
202202
return $collection;
203203
204-
Now, you can go to ``/hello/ryan`` (e.g. ``http://localhost:8000/app_dev.php/hello/ryan``
204+
Now, you can go to ``/hello/ryan`` (e.g. ``http://localhost:8000/hello/ryan``
205205
if you're using the :doc:`built-in web server </cookbook/web_server/built_in>`)
206206
and Symfony will execute the ``HelloController::indexAction()`` controller
207207
and pass in ``ryan`` for the ``$name`` variable. Creating a "page" means
@@ -490,7 +490,9 @@ You can also put templates in deeper sub-directories. Just try to avoid creating
490490
unnecessarily deep structures::
491491

492492
// renders app/Resources/views/hello/greetings/index.html.twig
493-
return $this->render('hello/greetings/index.html.twig', array('name' => $name));
493+
return $this->render('hello/greetings/index.html.twig', array(
494+
'name' => $name
495+
));
494496

495497
The Symfony templating engine is explained in great detail in the
496498
:doc:`Templating </book/templating>` chapter.
@@ -525,7 +527,7 @@ via the ``get()`` method. Here are several common services you might need::
525527

526528
$mailer = $this->get('mailer');
527529

528-
What other services exist? You can list all services, use the ``debug:container``
530+
What other services exist? To list all services, use the ``debug:container``
529531
console command:
530532

531533
.. code-block:: bash

cookbook/security/entity_provider.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@ interface requires three methods: ``loadUserByUsername($username)``,
435435
->setParameter('username', $username)
436436
->setParameter('email', $username)
437437
->getQuery()
438-
->getOneOrNullResult()
438+
->getOneOrNullResult();
439439

440-
if ($user) {
440+
if (null === $user) {
441441
$message = sprintf(
442442
'Unable to find an active admin AppBundle:User object identified by "%s".',
443443
$username

cookbook/serializer.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,16 @@ Here is an example on how to load the
7474

7575
.. code-block:: yaml
7676
77-
# app/config/config.yml
78-
services:
79-
get_set_method_normalizer:
80-
class: Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer
81-
tags:
82-
- { name: serializer.normalizer }
77+
# app/config/services.yml
78+
services:
79+
get_set_method_normalizer:
80+
class: Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer
81+
tags:
82+
- { name: serializer.normalizer }
8383
8484
.. code-block:: xml
8585
86-
<!-- app/config/config.xml -->
86+
<!-- app/config/services.xml -->
8787
<services>
8888
<service id="get_set_method_normalizer" class="Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer">
8989
<tag name="serializer.normalizer" />
@@ -92,7 +92,7 @@ Here is an example on how to load the
9292
9393
.. code-block:: php
9494
95-
// app/config/config.php
95+
// app/config/services.php
9696
use Symfony\Component\DependencyInjection\Definition;
9797
9898
$definition = new Definition(

0 commit comments

Comments
 (0)