官方英文资料(未自动翻译);本文按官方对应版本整理,保留说明和代码。站内处理包括移除站点导航、还原代码格式及调整链接。
Attributes are the successor to annotations since PHP 8. Attributes are native to the language and Symfony takes full advantage of them across the framework and its different components.
Doctrine Bridge
Contracts
Dependency Injection
- AsAlias
- AsDecorator
- AsTaggedItem
- Autoconfigure
- AutoconfigureResourceTag
- AutoconfigureTag
- Autowire
- AutowireCallable
- AutowireDecorated
- AutowireInline
- AutowireIterator
- AutowireLocator
- AutowireMethodOf
- AutowireServiceClosure
- Exclude
- Lazy
- TaggedIterator
- TaggedLocator
- Target
- When
- WhenNot
7.1
The TaggedIterator and TaggedLocator attributes were deprecated in Symfony 7.1.
EventDispatcher
FrameworkBundle
HttpKernel
JsonStreamer
Messenger
ObjectMapper
PHPUnit Bridge
RemoteEvent
Routing
Scheduler
Security
Serializer
Twig
- Template
- AsTwigFilter
- AsTwigFunction
AsTwigTest
Validator
Each validation constraint comes with a PHP attribute. See Validation Constraints Reference for a full list of validation constraints.
This work, including the code samples, is licensed under a
Creative Commons BY-SA 3.0 license.
TOC
Version
来源与许可
Symfony documentation contributors。本资料采用 CC BY-SA 3.0;本页为官方资料的站内整理版本,并非框架官方网站。 许可说明