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 @@ -893,3 +893,25 @@ array element. For example, to retrieve the ``handler_two`` handler::
893
893
])
894
894
;
895
895
};
896
+
897
+ The ``#[AsTaggedItem] `` attribute
898
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
899
+
900
+ It is possible to define both the priority and the index of a tagged
901
+ item thanks to the ``#[AsTaggedItem] `` attribute. This attribute must
902
+ be used directly on the class of the service you want to configure::
903
+
904
+ // src/Handler/One.php
905
+ namespace App\Handler;
906
+
907
+ use Symfony\Component\DependencyInjection\Attribute\AsTaggedItem;
908
+
909
+ #[AsTaggedItem(index: 'handler_one', priority: 10)]
910
+ class One
911
+ {
912
+ // ...
913
+ }
914
+
915
+ .. versionadded :: 5.3
916
+
917
+ The ``#[AsTaggedItem] `` attribute was introduced in Symfony 5.3.
You can’t perform that action at this time.
0 commit comments