File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -978,3 +978,25 @@ array element. For example, to retrieve the ``handler_two`` handler::
978
978
])
979
979
;
980
980
};
981
+
982
+ The ``#[AsTaggedItem] `` attribute
983
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
984
+
985
+ It is possible to define both the priority and the index of a tagged
986
+ item thanks to the ``#[AsTaggedItem] `` attribute. This attribute must
987
+ be used directly on the class of the service you want to configure::
988
+
989
+ // src/Handler/One.php
990
+ namespace App\Handler;
991
+
992
+ use Symfony\Component\DependencyInjection\Attribute\AsTaggedItem;
993
+
994
+ #[AsTaggedItem(index: 'handler_one', priority: 10)]
995
+ class One
996
+ {
997
+ // ...
998
+ }
999
+
1000
+ .. versionadded :: 5.3
1001
+
1002
+ The ``#[AsTaggedItem] `` attribute was introduced in Symfony 5.3.
You can’t perform that action at this time.
0 commit comments