Jump to:

23379 Posts in 18298 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » $Iterator doesn't work

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

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

Page: 1
Go to End
Author Topic: 1416 Views
  • Moose
    Avatar
    Community Member
    26 Posts

    $Iterator doesn't work Link to this post

    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!

  • Moose
    Avatar
    Community Member
    26 Posts

    Re: $Iterator doesn't work Link to this post

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

    1416 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.