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.

General Questions

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

Control ($Pos - 1)


Reply

2 Posts   848 Views

Avatar
web2works

18 June 2011 at 7:54pm Community Member, 50 Posts

Hi, I need to $Pos inside a control to start counting at 0. How would I do this without having loads of $Pos == 2 %>1 , $Pos == 3 %>2, etc

Avatar
simon_w

18 June 2011 at 8:51pm Forum Moderator, 474 Posts

$Pos(0) should work (the argument is the number to start counting from, defaults to 1).