--TEST-- "map" filter --TEMPLATE-- {% set offset = 3 %} {% for k, v in [1, 2]|map((item) => item + 2 ) -%} {{ k }} = {{ v }} {% endfor %} {% for k, v in {a: 1, b: 2}|map((item) => item ~ "*" ) -%} {{ k }} = {{ v }} {% endfor %} {% for k, v in {a: 1, b: 2}|map((item, k) => item ~ "*" ~ k ) -%} {{ k }} = {{ v }} {% endfor %} {% for k, v in [1, 2]|map(item => item + 2 ) -%} {{ k }} = {{ v }} {% endfor %} {% for k, v in it|map(item => item + 2 ) -%} {{ k }} = {{ v }} {% endfor %} {% macro local_lower(string) %} {{- string|lower }} {% endmacro %} {{ ['A']|map(val => _self.local_lower(val))|join }} {%- from _self import local_lower as renamed_lower %} {{ ['A']|map(val => renamed_lower(val))|join }} --DATA-- return ['it' => new \ArrayIterator([1, 2])] --EXPECT-- 0 = 3 1 = 4 a = 1* b = 2* a = 1*a b = 2*b 0 = 3 1 = 4 0 = 3 1 = 4 a a
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
abs.test | File | 391 B | 0644 |
|
batch.test | File | 694 B | 0644 |
|
batch_float.test | File | 667 B | 0644 |
|
batch_with_empty_fill.test | File | 563 B | 0644 |
|
batch_with_exact_elements.test | File | 772 B | 0644 |
|
batch_with_fill.test | File | 575 B | 0644 |
|
batch_with_keys.test | File | 250 B | 0644 |
|
batch_with_more_elements.test | File | 535 B | 0644 |
|
batch_with_zero_elements.test | File | 148 B | 0644 |
|
column.test | File | 311 B | 0644 |
|
convert_encoding.test | File | 218 B | 0644 |
|
date.test | File | 2.35 KB | 0644 |
|
date_default_format.test | File | 316 B | 0644 |
|
date_default_format_interval.test | File | 331 B | 0644 |
|
date_immutable.test | File | 984 B | 0644 |
|
date_interval.test | File | 420 B | 0644 |
|
date_modify.test | File | 339 B | 0644 |
|
date_namedargs.test | File | 418 B | 0644 |
|
default.test | File | 4.19 KB | 0644 |
|
dynamic_filter.test | File | 128 B | 0644 |
|
escape.test | File | 106 B | 0644 |
|
escape_html_attr.test | File | 199 B | 0644 |
|
escape_javascript.test | File | 133 B | 0644 |
|
escape_non_supported_charset.test | File | 148 B | 0644 |
|
filter.test | File | 1.39 KB | 0644 |
|
first.test | File | 251 B | 0644 |
|
force_escape.test | File | 295 B | 0644 |
|
format.test | File | 137 B | 0644 |
|
join.test | File | 782 B | 0644 |
|
json_encode.test | File | 229 B | 0644 |
|
last.test | File | 244 B | 0644 |
|
length.test | File | 1.05 KB | 0644 |
|
length_utf8.test | File | 177 B | 0644 |
|
map.test | File | 872 B | 0644 |
|
merge.test | File | 553 B | 0644 |
|
nl2br.test | File | 377 B | 0644 |
|
number_format.test | File | 300 B | 0644 |
|
number_format_default.test | File | 446 B | 0644 |
|
reduce.test | File | 264 B | 0644 |
|
replace.test | File | 446 B | 0644 |
|
replace_invalid_arg.test | File | 314 B | 0644 |
|
reverse.test | File | 427 B | 0644 |
|
round.test | File | 257 B | 0644 |
|
slice.test | File | 996 B | 0644 |
|
sort.test | File | 261 B | 0644 |
|
sort_with_arrow.test | File | 490 B | 0644 |
|
spaceless.test | File | 163 B | 0644 |
|
special_chars.test | File | 94 B | 0644 |
|
split.test | File | 535 B | 0644 |
|
split_utf8.test | File | 470 B | 0644 |
|
static_calls.test | File | 170 B | 0644 |
|
trim.test | File | 686 B | 0644 |
|
urlencode.test | File | 492 B | 0644 |
|