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

How to obtain the current position in control loop


Go to End


11 Posts   5732 Views

Avatar
UncleCheese

Forum Moderator, 4102 Posts

28 February 2009 at 7:10am

You're going to be waiting a while on that one. SSViewer doesn't accept dynamic values for arguments in functions.

What I would do is just augment a static class variable every time the function runs

so..

static $form_count = 0;
function CalendarForm()
{
self::$form_count++;
// do stuff
return a form with id="some_form_".self::$form_count
}

Avatar
Terminator4

Community Member, 81 Posts

28 February 2009 at 9:43am

Hey UncleCheese,
Just an update as to the SSViewer. Earlier today I managed to write the code for SSViewer to access dynamic values. I managed to get it to accept one value and then managed to fix it to allow for unlimited parameters to be passed. So, now it will work perfectly with dynamic values with/without control loops.

You can view my submission at: http://open.silverstripe.com/ticket/3633

Avatar
UncleCheese

Forum Moderator, 4102 Posts

28 February 2009 at 11:47am

Nice work. I would love to see this functionality integrated into Silverstripe. Anxious to hear what comes of it.

Go to Top