File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -515,6 +515,45 @@ To answer this, change the service declaration:
515
515
;
516
516
};
517
517
518
+ .. tip ::
519
+
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:
522
+
523
+ .. configuration-block ::
524
+
525
+ .. code-block :: yaml
526
+
527
+ # config/services.yaml
528
+ services :
529
+ MailerSmtpTransport :
530
+ arguments : ['%mailer_host%']
531
+ tags :
532
+ - app.mail_transport : { name: 'arbitrary-value', alias: 'smtp' }
533
+
534
+ .. code-block :: xml
535
+
536
+ <!-- config/services.xml -->
537
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
538
+ <container xmlns =" http://symfony.com/schema/dic/services"
539
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
540
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
541
+ https://symfony.com/schema/dic/services/services-1.0.xsd" >
542
+
543
+ <services >
544
+ <service id =" MailerSmtpTransport" >
545
+ <argument >%mailer_host%</argument >
546
+
547
+ <tag name =" arbitrary-value" alias =" smtp" >app.mail_transport</tag >
548
+ </service >
549
+ </services >
550
+ </container >
551
+
552
+ .. versionadded :: 5.1
553
+
554
+ The possibility to add the ``name `` attribute to a tag in XML and YAML
555
+ formats was introduced in Symfony 5.1.
556
+
518
557
.. tip ::
519
558
520
559
In YAML format, you may provide the tag as a simple string as long as
You can’t perform that action at this time.
0 commit comments