Join the elements of an array into a string, using PHP's implode function.
- Service:
CleverAge\ProcessBundle\Transformer\String\ImplodeTransformer - Transformer code:
implode
array of values that can be cast to string. Any other input throws an \UnexpectedValueException.
string
| Code | Type | Required | Default | Description |
|---|---|---|---|---|
separator |
string |
'|' |
String inserted between each element |
['1', '2', '3']becomes'1|2|3'
# Transformer options level
implode: ~- Concatenate then slugify several fields
# Transformer mapping level
slug:
code:
- '[id]'
- '[firstname]'
- '[lastname]'
transformers:
implode:
separator: '-'
slugify: ~