Skip to content

Commit 7f0172c

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Some fixes for testing/* articles in 2.7 docs Fixed some issues in PHPUnit XML config examples Removed a wrong note about controllers as services Removed lots of redundant contents [#8650] Minor rewording [#8649] Small reword Improved the link to the Symfony events reference Minor fixes for upload_file.rst Fixed a typo Added getSubscribedEvents() to UserLocaleSubscriber Reworded the explanation about service tags Reworded the intro of reference/dic_tags.rst Fixed RST syntax issue Revamped the reference/events.rst article Change some docs to be gender-neutral
2 parents 510c6d8 + 2229669 commit 7f0172c

File tree

10 files changed

+128
-152
lines changed

10 files changed

+128
-152
lines changed

controller/service.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ defined above with the id ``app.hello_controller``::
104104

105105
.. note::
106106

107-
You cannot drop the ``Action`` part of the method name when using this
108-
syntax.
107+
Make sure the method name in your route (e.g. ``indexAction``) matches the
108+
method name exactly. Unlike the traditional ``Bundle:Controller:method``
109+
notation, the ``Action`` suffix is not automatically added for you.
109110

110111
You can also route to the service by using the same notation when defining
111112
the route ``_controller`` value:

controller/upload_file.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ to :doc:`customize form rendering </form/form_customization>`):
108108
Finally, you need to update the code of the controller that handles the form::
109109

110110
// src/AppBundle/Controller/ProductController.php
111-
namespace AppBundle\ProductController;
111+
namespace AppBundle\Controller;
112112

113113
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
114114
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
@@ -391,15 +391,16 @@ Now, register this class as a Doctrine listener:
391391
http://symfony.com/schema/dic/services/services-1.0.xsd">
392392
<!-- ... -->
393393
394-
<service id="app.doctrine_brochure_listener"
395-
class="AppBundle\EventListener\BrochureUploaderListener"
396-
>
397-
<argument type="service" id="app.brochure_uploader"/>
398-
399-
<tag name="doctrine.event_listener" event="prePersist"/>
400-
<tag name="doctrine.event_listener" event="preUpdate"/>
401-
</service>
394+
<services>
395+
<service id="app.doctrine_brochure_listener"
396+
class="AppBundle\EventListener\BrochureUploaderListener"
397+
>
398+
<argument type="service" id="app.brochure_uploader"/>
402399
400+
<tag name="doctrine.event_listener" event="prePersist"/>
401+
<tag name="doctrine.event_listener" event="preUpdate"/>
402+
</service>
403+
</services>
403404
</container>
404405
405406
.. code-block:: php

event_dispatcher.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ The most common way to listen to an event is to register an **event listener**::
6464

6565
Each event receives a slightly different type of ``$event`` object. For
6666
the ``kernel.exception`` event, it is :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent`.
67-
To see what type of object each event listener receives, see :class:`Symfony\\Component\\HttpKernel\\KernelEvents`
68-
or the documentation about the specific event you're listening to.
67+
Check out the :doc:`Symfony events reference </reference/events>` to see
68+
what type of object each event provides.
6969

7070
Now that the class is created, you just need to register it as a service and
7171
notify Symfony that it is a "listener" on the ``kernel.exception`` event by

form/events.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Creating and binding an event listener to the form is very easy::
295295
return;
296296
}
297297

298-
// Check whether the user has chosen to display his email or not.
298+
// Check whether the user has chosen to display their email or not.
299299
// If the data was submitted previously, the additional value that is
300300
// included in the request variables needs to be removed.
301301
if (true === $user['show_email']) {
@@ -376,7 +376,7 @@ Event subscribers have different uses:
376376
$form = $event->getForm();
377377
378378
// Check whether the user from the initial data has chosen to
379-
// display his email or not.
379+
// display their email or not.
380380
if (true === $user->isShowEmail()) {
381381
$form->add('email', EmailType::class);
382382
}
@@ -391,7 +391,7 @@ Event subscribers have different uses:
391391
return;
392392
}
393393
394-
// Check whether the user has chosen to display his email or not.
394+
// Check whether the user has chosen to display their email or not.
395395
// If the data was submitted previously, the additional value that
396396
// is included in the request variables needs to be removed.
397397
if (true === $user['show_email']) {

reference/dic_tags.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
The Dependency Injection Tags
1+
Built-in Symfony Service Tags
22
=============================
33

4-
Dependency Injection Tags are little strings that can be applied to a service
5-
to "flag" it to be used in some special way. For example, if you have a
6-
service that you would like to register as a listener to one of Symfony's
7-
core events, you can flag it with the ``kernel.event_listener`` tag.
4+
:doc:`Service tags </service_container/tags>` are the mechanism used by the
5+
:doc:`DependencyInjection component </components/dependency_injection>` to flag
6+
services that require special processing, like console commands or Twig extensions.
87

9-
You can learn a little bit more about "tags" by reading the ":doc:`/service_container/tags`"
10-
article.
11-
12-
Below is information about all of the tags available inside Symfony. There
13-
may also be tags in other bundles you use that aren't listed here.
8+
These are the most common tags provided by Symfony components, but in your
9+
application there could be more tags available provided by third-party bundles:
1410

1511
======================================== ========================================================================
1612
Tag Name Usage

0 commit comments

Comments
 (0)