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

Commit634b284

Browse files
committed
feature#12741 [DependencyInjection] Bind tagged services (tienvx)
This PR was merged into the 4.4 branch.Discussion----------[DependencyInjection] Bind tagged servicesUpdate documentation forhttps://symfony.com/blog/new-in-symfony-4-4-dependency-injection-improvements-part-1#allow-binding-tagged-servicesNOTE: this documentation requiresymfony/symfony#34732 to be mergedCommits-------7ec6d9d [DependencyInjection] Bind tagged services
2 parents230fb24 +7ec6d9d commit634b284

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎service_container.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ You can also use the ``bind`` keyword to bind specific arguments by name or type
665665
# optionally you can define both the name and type of the argument to match
666666
string $adminEmail:'manager@example.com'
667667
Psr\Log\LoggerInterface $requestLogger:'@monolog.logger.request'
668+
iterable $rules:!tagged_iterator app.foo.rule
668669
669670
# ...
670671
@@ -695,6 +696,10 @@ You can also use the ``bind`` keyword to bind specific arguments by name or type
695696
type="service"
696697
id="monolog.logger.request"
697698
/>
699+
<bindkey="iterable $rules"
700+
type="tagged_iterator"
701+
tag="app.foo.rule"
702+
/>
698703
</defaults>
699704
700705
<!-- ...-->
@@ -728,6 +733,7 @@ You can also use the ``bind`` keyword to bind specific arguments by name or type
728733
// optionally you can define both the name and type of the argument to match
729734
->bind('string $adminEmail', 'manager@example.com')
730735
->bind(LoggerInterface::class.' $requestLogger', ref('monolog.logger.request'))
736+
->bind('iterable $rules', tagged_iterator('app.foo.rule'))
731737
;
732738
733739
// ...

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp