You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
449 B
27 lines
449 B
--TEST--
|
|
Twig supports __call() for attributes
|
|
--TEMPLATE--
|
|
{{ foo.foo }}
|
|
{{ foo.bar }}
|
|
--DATA--
|
|
class TestClassForMagicCallAttributes
|
|
{
|
|
public function getBar()
|
|
{
|
|
return 'bar_from_getbar';
|
|
}
|
|
|
|
public function __call($method, $arguments)
|
|
{
|
|
if ('foo' === $method)
|
|
{
|
|
return 'foo_from_call';
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
return array('foo' => new TestClassForMagicCallAttributes())
|
|
--EXPECT--
|
|
foo_from_call
|
|
bar_from_getbar
|
|
|