Skip to content

Instantly share code, notes, and snippets.

@jedateach
Created May 3, 2012 03:39
Show Gist options
  • Save jedateach/2582956 to your computer and use it in GitHub Desktop.
Save jedateach/2582956 to your computer and use it in GitHub Desktop.
Running Total Extension for DataObjectSet
<?php
class RunningTotalExtension extends Extension{
private static $runningtotal = 0;
function RunningTotal(){
return self::$runningtotal ++;
}
}
<% control MyObjects %>
$Me.RunningTotal
<% end_control %>
@jedateach
Copy link
Author

This won't work... the running total should be a method on your DataObject. ...which is what $Me refers to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment