[TASK] Allow escaping of characters inside accessor paths
currently it's not possible to access keys of arrays that contain fluid specific characters like . { } etc. although that's not a usecase that we "endorse" using those characters inside accessor paths, but there's a relatively valid usecase to use a "." inside the array key when you assign typoscript values into fluid which contains dots for the array keys
example*
<?php
$view->assign('foo',
'foo' => array(
'bar.' => 'dasoidjo'
)
);
{foo.bar\.}
if you can make the getPropertyPath method split on only un-escaped dots it should work
This would be awesome, how is the status on this ?
Hey.
My assessment after dealing with StandardVariableProvider and it's friends for a while: I don't think we should strive to support this anytime soon.
Claus had a PR on this with https://github.com/TYPO3/Fluid/pull/425, but I don't think this is the way to go since it increases complexity quite a bit and has a significant negative impact on performance: The variable provider construct is one of the most heavily used constructs at runtime within Fluid, we should strive for further streamlining and simplification instead.
As such, I'll close the PR for now, and will look into more options to further improve perfomance in this area with additional patches - I think there is still quite some potential if we pre-optimize lookups in compiled templates for instance, by providing some more specialized (quicker) methods for cases that can be sorted out at compile-time (eg. splitting by array early and see if there are sub references at all in the dotted variable string).
I'd say, performance has a higher priority than having variable names that include dots and curly braces, since those can be avoided relatively easily in most cases. As such, I'll close this issue for now.