C# (CSharp) NVelocity.App.Tools Namespace

Classes

Name Description
VelocityFormatter Formatting tool for inserting into the Velocity WebContext. Can format dates or lists of objects.

Here's an example of some uses:

 $formatter.formatShortDate($object.Date) $formatter.formatLongDate($db.getRecord(232).getDate()) $formatter.formatArray($array) $formatter.limitLen(30, $object.Description) 

VelocityFormatter.VelocityAlternator Class that returns alternating values in a template. It stores a list of alternate Strings, whenever alternate() is called it switches to the next in the list. The current alternate is retrieved through toString() - i.e. just by referencing the object in a Velocity template. For an example of usage see the makeAlternator() method below.
VelocityFormatter.VelocityAutoAlternator As VelocityAlternator, but calls alternate() automatically on rendering in a template.