Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9e42c2b

Browse files
committed
feature#17694 [DependencyInjection] Add#[AsTaggedItem] documentation (alexandre-daubois)
This PR was merged into the 5.4 branch.Discussion----------[DependencyInjection] Add `#[AsTaggedItem]` documentationPart of#17563Commits-------49e2405 [DependencyInjection] Add #[AsTaggedItem] documentation
2 parents29ad979 +49e2405 commit9e42c2b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

‎service_container/tags.rst‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,3 +897,25 @@ array element. For example, to retrieve the ``handler_two`` handler::
897897
])
898898
;
899899
};
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.3
920+
921+
The ``#[AsTaggedItem]`` attribute was introduced in Symfony 5.3 and requires PHP 8.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp