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 scalars, null or \Stringable values, cast to strings. Any other input, null included, or an item that
is an array or another object 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: ~