File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -83,20 +83,20 @@ You can also use multi dimensional arrays::
83
83
84
84
.. tip ::
85
85
86
- If the key of the array contains a dot ``. `` or a left squared bracket ``[ ``,
87
- it is possible to escape these characters with a backslash. In the above example,
88
- if the array key `` first_name `` becomes `` first.name ``, accessing the value can
89
- be achieved like this ::
86
+ If the key of the array contains a dot ``. `` or a left square bracket ``[ ``,
87
+ you must escape those characters with a backslash. In the above example,
88
+ if the array key was `` first.name `` instead of `` first_name ``, you should
89
+ access its value as follows ::
90
90
91
91
var_dump($propertyAccessor->getValue($persons, '[0][first\.name]')); // 'Wouter'
92
92
var_dump($propertyAccessor->getValue($persons, '[1][first\.name]')); // 'Ryan'
93
93
94
- Right squared brackets ``] `` don't need to be escaped.
94
+ Right square brackets ``] `` don't need to be escaped in array keys .
95
95
96
- .. versionadded :: 6.3
96
+ .. versionadded :: 6.3
97
97
98
- Escaping dots and left squared bracket in a property path was
99
- introduced in Symfony 6.3.
98
+ Escaping dots and left square brackets in a property path was
99
+ introduced in Symfony 6.3.
100
100
101
101
Reading from Objects
102
102
--------------------
You can’t perform that action at this time.
0 commit comments