Skip to content

Commit 558be21

Browse files
committed
minor #8651 Reworded the explanation about service tags (javiereguiluz)
This PR was squashed before being merged into the 2.7 branch (closes #8651). Discussion ---------- Reworded the explanation about service tags Commits ------- c03b5e3 Removed lots of redundant contents 2b93b7d Reworded the explanation about service tags
2 parents 9c29f08 + c03b5e3 commit 558be21

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

service_container/tags.rst

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
How to Work with Service Tags
66
=============================
77

8-
In the same way that a blog post on the web might be tagged with things such
9-
as "Symfony" or "PHP", services configured in your container can also be
10-
tagged. In the service container, a tag implies that the service is meant
11-
to be used for a specific purpose. Take the following example:
8+
**Service tags** are a way to tell Symfony or other third-party bundles that
9+
your service should be registered in some special way. Take the following
10+
example:
1211

1312
.. configuration-block::
1413

@@ -51,19 +50,13 @@ to be used for a specific purpose. Take the following example:
5150
->setPublic(false)
5251
->addTag('twig.extension');
5352
54-
The ``twig.extension`` tag is a special tag that the TwigBundle uses
55-
during configuration. By giving the service this ``twig.extension`` tag,
56-
the bundle knows that the ``app.twig_extension`` service should be registered
57-
as a Twig extension with Twig. In other words, Twig finds all services tagged
58-
with ``twig.extension`` and automatically registers them as extensions.
53+
Services tagged with the ``twig.extension`` tag are collected during the
54+
initialization of TwigBundle and added to Twig as extensions.
5955

60-
Tags, then, are a way to tell Symfony or other third-party bundles that
61-
your service should be registered or used in some special way by the bundle.
62-
63-
For a list of all the tags available in the core Symfony Framework, check
64-
out :doc:`/reference/dic_tags`. Each of these has a different effect on your
65-
service and many tags require additional arguments (beyond just the ``name``
66-
parameter).
56+
Other tags are used to integrate your services into other systems. For a list of
57+
all the tags available in the core Symfony Framework, check out
58+
:doc:`/reference/dic_tags`. Each of these has a different effect on your service
59+
and many tags require additional arguments (beyond just the ``name`` parameter).
6760

6861
Creating custom Tags
6962
--------------------

0 commit comments

Comments
 (0)