to_array
Filter to cast variables to array. Equivalent to PHP’s (array) $variable
.
Returns
array Variable casted
Examples
{# Create an array containing the active user id and dump the result #}
{% set users = juser.get('id')|to_array %}
{{ dump(users) }}