Feature #7203

Object accessor could work for associative arrays

Added by Michael Sauter over 5 years ago. Updated about 4 years ago.

Status:Resolved Start date:2010-04-10
Priority:Should have Due date:
Assigned To:- % Done:

50%

Category:Core
Target version:-
Has patch:

Description

I'm not exactly sure if this is a bug or a missing feature:

The manual (http://flow3.typo3.org/documentation/manuals/fluid/fluid.usermanual/#d0e161) states that it is possible to traverse associative arrays with the object accessor syntax.

I thought it should be used like this (correct my if I'm mistaken):
$foo = array('bar' => array('baz' => 'value'));
$this->view->assign('foo', $foo);
And in Fluid:
{foo.bar.baz}
Which would result in:
value

This does not work though (r4040). The problem seems to be in Parser/SyntaxTree/ObjectAccessorNode.php. There, either the property of an object is resolved or the variable is directly returned.

Applied patch adds the functionality to traverse associative arrays. It's probably not the cleanest solution though ...

array_access.diff Magnifier (941 Bytes) Michael Sauter, 2010-04-10 09:39


Related issues

related to TYPO3.Flow - Feature #6390: ObjectAccess::getPropertyPath doesn't support Arrays Resolved 2010-04-16

History

#1 Updated by Karsten Dambekalns over 5 years ago

  • Status changed from New to Accepted
  • Assigned To set to Sebastian Kurfuerst
  • % Done changed from 0 to 50

For Fluid 4.x the fix for #6390 has to be applied to Extbase.

#2 Updated by Sebastian Kurfuerst about 5 years ago

  • Assigned To deleted (Sebastian Kurfuerst)

#3 Updated by Sebastian Kurfuerst about 4 years ago

  • Status changed from Accepted to Resolved

resolved.

Also available in: Atom PDF