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