简体   繁体   中英

TYPO3 Fluid Array Access

I have a question to access an array in fluid:

Associative Array {registrationProcess}
STRING  {fieldname} == 'firstName'
STRING  {property} == 'participant'
WORKING {registrationProcess.participant.{fieldname}}
WORKING {registrationProcess.{property}.firstName}
WORKING {registrationProcess.participant.firstName}
NULL    {registrationProcess.{property}.{fieldname}}

Why is the result of the last notation NULL???

Fluid currently only supports one dynamic property per level. Fluid 3.0 will change that but until that time, you have to extract the first dynamic expression to a variable and then perform the second dynamic expression on that new variable:

<f:variable
  name="registrationProperty"
  value="{registrationProcess.{property}}"
/>

{registrationProperty.{fieldname}}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM