Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

$Iterator doesn't work

Go to End

2 Posts   1847 Views


Community Member, 26 Posts

16 April 2009 at 9:28pm


I need to access the numerical index in a control loop. I was thrilled to find the following
"you can use $Iterator inside a control-block to access the numerical index of the current item".

Unfortunately I get the following error when I try use $Iterator in a 'control children' structure:
Fatal error: Call to undefined method ViewableData_Iterator::forTemplate()

Any ideas?



Community Member, 26 Posts

16 April 2009 at 9:41pm

The article that I found was incorrect - I see that the correct method is $pos. I'll respond to the article.