@@ -517,8 +517,9 @@ To answer this, change the service declaration:
517517
518518 .. tip ::
519519
520- In XML and YAML format, you may provide the tag an attribute called ``name ``.
521- When doing so, this is the syntax you should follow:
520+ The ``name `` attribute is used by default to define the name of the tag.
521+ If you want to add a ``name `` attribute to some tag in XML or YAML formats,
522+ you need to use this special syntax:
522523
523524 .. configuration-block ::
524525
@@ -529,6 +530,9 @@ To answer this, change the service declaration:
529530 MailerSmtpTransport :
530531 arguments : ['%mailer_host%']
531532 tags :
533+ # this is a tag called 'app.mail_transport'
534+ - { name: 'app.mail_transport', alias: 'smtp' }
535+ # this is a tag called 'app.mail_transport' with two attributes ('name' and 'alias')
532536 - app.mail_transport : { name: 'arbitrary-value', alias: 'smtp' }
533537
534538 .. code-block :: xml
@@ -543,7 +547,9 @@ To answer this, change the service declaration:
543547 <services >
544548 <service id =" MailerSmtpTransport" >
545549 <argument >%mailer_host%</argument >
546-
550+ <!-- this is a tag called 'app.mail_transport' -->
551+ <tag name =" app.mail_transport" alias =" sendmail" />
552+ <!-- this is a tag called 'app.mail_transport' with two attributes ('name' and 'alias') -->
547553 <tag name =" arbitrary-value" alias =" smtp" >app.mail_transport</tag >
548554 </service >
549555 </services >
0 commit comments