Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.15 KB

File metadata and controls

52 lines (38 loc) · 1.15 KB

ExplodeTransformer

Split a string into an array, using PHP's explode function.

Transformer reference

  • Service: CleverAge\ProcessBundle\Transformer\String\ExplodeTransformer
  • Transformer code: explode

Accepted inputs

Any value that can be cast to string, or null.

Possible outputs

array: the list of parts; an empty array if the input is null or an empty string

Options

Code Type Required Default Description
delimiter string X The boundary string, must not be empty

Examples

  • 'a,b,c' becomes ['a', 'b', 'c']
# Transformer options level
explode:
  delimiter: ','
  • Split then trim each part: 'a, b ,c' becomes ['a', 'b', 'c']
# Transformer mapping level
tags:
  code: '[tags]'
  transformers:
    explode:
      delimiter: ','
    array_map:
      transformers:
        trim: ~