1--TEST-- 2"attribute" function 3--TEMPLATE-- 4{{ attribute(obj, method) }} 5{{ attribute(array, item) }} 6{{ attribute(obj, "bar", ["a", "b"]) }} 7{{ attribute(obj, "bar", arguments) }} 8{{ attribute(obj, method) is defined ? 'ok' : 'ko' }} 9{{ attribute(obj, nonmethod) is defined ? 'ok' : 'ko' }} 10--DATA-- 11return ['obj' => new TwigTestFoo(), 'method' => 'foo', 'array' => ['foo' => 'bar'], 'item' => 'foo', 'nonmethod' => 'xxx', 'arguments' => ['a', 'b']] 12--EXPECT-- 13foo 14bar 15bar_a-b 16bar_a-b 17ok 18ko 19