[TYPO3-mvc] Interresting problem with 'Duplicate variable declariations!'
Claus Due
claus at wildside.dk
Thu Nov 1 10:33:29 CET 2012
> I'll try to move this extended for loop into a section and see if it'll do a difference, tough I'm not sure, as I stated: in the first cycle everything works as expected, but the following cycles fail.
This is why you should move the inner cycle to a section and only pass it the exact variables it needs. This way there is no risk of something bleeding through from a ViewHelper that has set a template variable (and ViewHelpers which use ViewHelperVariableContainer and have collissions there will give another error).
I'm only suggesting this because it will be much harder to identify exactly which variable is being duplicated than it will be to avoid it completely. It IS possible to debug your way through this but you really don't want to go that way. You can trust me on that ;)
In general it's nice to use Sections. They're cached as native php functions so performance is fine even with many, many sections.
Cheers,
Claus
More information about the TYPO3-project-typo3v4mvc
mailing list