[TYPO3-mvc] Object accessor containing object accessors
Laurent Foulloy
yolf.typo3 at orange.fr
Fri Aug 13 18:57:31 CEST 2010
Hi all,
A local variable must be used for the replacement otherwise, <f:for >
loops are not processed correctly. The corrected solution is :
// Added to parse the inner accessors if any
$objectPath = $this->objectPath;
if
(preg_match('/^(?P<Start>[^{]*)(?P<ObjectAccesor>{.*})(?P<End>[^}]*)$/',
$objectPath, $matchedVariables) > 0) {
$templateParser =
Tx_Fluid_Compatibility_TemplateParserBuilder::build();
$parsedTemplate =
$templateParser->parse($matchedVariables['ObjectAccesor']);
$objectPath = $matchedVariables['Start'] .
$parsedTemplate->render($this->renderingContext) . $matchedVariables['End'];
}
$objectPathParts = explode('.', $objectPath);
Laurent Foulloy a écrit :
>
> The syntax makes sense for me. The proposed solution is working fine but
> I'm looking for a better one if any.
More information about the TYPO3-project-typo3v4mvc
mailing list