Feature #7203

Object accessor could work for associative arrays

Added by Michael Sauter over 11 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Core
Target version:
-
Start date:
2010-04-10
Due date:
% Done:

50%

Estimated time:
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 ...


Files

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

Related issues

Related to TYPO3.Flow - Feature #6390: ObjectAccess::getPropertyPath doesn't support ArraysResolvedKarsten Dambekalns2010-04-16

Actions
#1

Updated by Karsten Dambekalns over 11 years ago

  • Status changed from New to Accepted
  • Assignee 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 over 11 years ago

  • Assignee deleted (Sebastian Kurfuerst)
#3

Updated by Sebastian Kurfuerst over 10 years ago

  • Status changed from Accepted to Resolved

resolved.

Also available in: Atom PDF