Return a formatted string.
This transformer uses the php internal function: https://www.php.net/manual/en/function.vsprintf.php
- Service:
CleverAge\ProcessBundle\Transformer\String\SprintfTransformer - Transformer code:
sprintf
Any value that can be cast to string | int | float or array
string
| Code | Type | Required | Default | Description |
|---|---|---|---|---|
format |
string |
X | %s |
The format string is composed of zero or more directives. Escape % with another %% due to ParameterBag restrictions. |
# Transformer mapping level
sprintf_one:
code: '[firstname]'
transformers:
sprintf:
format: 'one/%%d'
sprintf_multiple:
code:
- '[firstname]'
- '[lastname]'
transformers:
sprintf:
format: 'multiple/%%s/%%s'