mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 03:46:39 +00:00
35 lines
634 B
Plaintext
35 lines
634 B
Plaintext
--TEST--
|
|
Twig supports method calls
|
|
--TEMPLATE--
|
|
{{ items.foo.foo }}
|
|
{{ items.foo.getFoo() }}
|
|
{{ items.foo.bar }}
|
|
{{ items.foo['bar'] }}
|
|
{{ items.foo.bar('a', 43) }}
|
|
{{ items.foo.bar(param1: 'a', param2: 43) }}
|
|
{{ items.foo.bar(param2: 43, param1: 'a') }}
|
|
{{ items.foo.bar('a', param2: 43) }}
|
|
{{ items.foo.bar(foo) }}
|
|
{{ items.foo.self.foo() }}
|
|
{{ items.foo.is }}
|
|
{{ items.foo.in }}
|
|
{{ items.foo.not }}
|
|
--DATA--
|
|
return ['foo' => 'bar', 'items' => ['foo' => new Twig\Tests\TwigTestFoo(), 'bar' => 'foo']]
|
|
--CONFIG--
|
|
return ['strict_variables' => false]
|
|
--EXPECT--
|
|
foo
|
|
foo
|
|
bar
|
|
|
|
bar_a-43
|
|
bar_a-43
|
|
bar_a-43
|
|
bar_a-43
|
|
bar_bar
|
|
foo
|
|
is
|
|
in
|
|
not
|