Skip to content

Commit a381f74

Browse files
committed
[DOCS] Improve object property access documentation
1 parent 587f20a commit a381f74

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Documentation/Syntax/Variables.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ This also works for object properties:
3636

3737
<p>{product.name}: {product.price}</p>
3838

39+
These object properties are obtained by evaluating a fallback chain,
40+
which includes various getter methods as well as direct property access.
41+
For example, the following PHP-equivalents would be checked for `{product.name}`:
42+
43+
.. code-block:: php
44+
45+
$product->getName()
46+
$product->isName()
47+
$product->hasName()
48+
$product->name
49+
50+
Also, both `ArrayAccess` and the PSR `ContainerInterface` are supported.
51+
3952
.. _dynamic-properties:
4053

4154
Dynamic keys/properties

0 commit comments

Comments
 (0)