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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   2249 Views

Avatar
Moose

Community Member, 26 Posts

16 April 2009 at 9:28pm

Hi

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?

Thanks!

Avatar
Moose

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.