Tag metadata
Tag metadata is specified as a key-value pair:
- metadata name – an arbitrary, non-empty string.
- value – a scalar type,
null, or anarrayconsisting of these types.
Tag metadata is passed via the $options parameter in the bindTag()[1] method or within the \Kaspi\DiContainer\Attributes\Tag attribute.
WARNING
In the metadata, the name priority.method is reserved for the priority method.
php
$options = [
'foo' => 'bar',
'baz' => true,
'priority.method' => 'getPriority'
]More about priority in the collection.
To specify tags, use the
bindTag()method, which is available in helper functions:diAutowire(),diCallable(),diProxyClosure(),diValue(). ↩︎