Let's say we have an object which have another object bound to one of the properties.
class NestedObject
{
public $property;
public $value = -1;
public function toLiquid() {
return array(
'property' => $this->property,
'value' => 42,
);
}
}
For the sake of example let's use the same object type.
$object = new NestedObject();
$object->property = new NestedObject();
Now, if we would try accessing embedded object's property...
{{ object.property.value }}
We'll get not 42 as we may expect from having it set in toLiquid but -1.
Let's say we have an object which have another object bound to one of the properties.
For the sake of example let's use the same object type.
Now, if we would try accessing embedded object's property...
We'll get not
42
as we may expect from having it set intoLiquid
but-1
.