Presenter Output
This section will show you how to use the decorated value provided by the \Anomaly\TagsFieldType\TagsFieldTypePresenter
class.
TagsFieldTypePresenter::labels()
The labels
method returns an array of labels from select tags.
Returns: array
Arguments
Key | Required | Type | Default | Description |
---|---|---|---|---|
$context | false | string | defaut | The label context color. Valid options are `success`, `info`, `warning`, `danger`, and `default`. |
$size | false | string | sm | The label size. Valid options are `xs`, `sm`, and `lg`. |
Example
foreach ($decorated->labels('success') as $label) {
echo $label;
}
Twig
{{ decorated.labels('success')|join(' ')|raw }}