--TEST-- "attribute" function --TEMPLATE-- {{ attribute(obj, method) }} {{ attribute(array, item) }} {{ attribute(obj, "bar", ["a", "b"]) }} {{ attribute(obj, "bar", arguments) }} {{ attribute(obj, method) is defined ? 'ok' : 'ko' }} {{ attribute(obj, nonmethod) is defined ? 'ok' : 'ko' }} --DATA-- return ['obj' => new Twig\Tests\TwigTestFoo(), 'method' => 'foo', 'array' => ['foo' => 'bar'], 'item' => 'foo', 'nonmethod' => 'xxx', 'arguments' => ['a', 'b']] --EXPECT-- foo bar bar_a-b bar_a-b ok ko
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
include | Folder | 0755 |
|
|
attribute.test | File | 502 B | 0644 |
|
block.test | File | 245 B | 0644 |
|
block_with_template.test | File | 515 B | 0644 |
|
block_without_name.test | File | 361 B | 0644 |
|
block_without_parent.test | File | 416 B | 0644 |
|
constant.test | File | 234 B | 0644 |
|
cycle.test | File | 295 B | 0644 |
|
date.test | File | 965 B | 0644 |
|
date_namedargs.test | File | 342 B | 0644 |
|
dump.test | File | 291 B | 0644 |
|
dump_array.test | File | 472 B | 0644 |
|
dynamic_function.test | File | 132 B | 0644 |
|
include_template_from_string.test | File | 243 B | 0644 |
|
magic_call.test | File | 98 B | 0644 |
|
magic_static_call.test | File | 164 B | 0644 |
|
max.test | File | 187 B | 0644 |
|
min.test | File | 188 B | 0644 |
|
range.test | File | 129 B | 0644 |
|
recursive_block_with_inheritance.test | File | 1.1 KB | 0644 |
|
source.test | File | 169 B | 0644 |
|
special_chars.test | File | 97 B | 0644 |
|
static_calls.test | File | 174 B | 0644 |
|
template_from_string.test | File | 451 B | 0644 |
|
template_from_string_error.test | File | 313 B | 0644 |
|
undefined_block.test | File | 416 B | 0644 |
|
undefined_block_deep.test | File | 558 B | 0644 |
|