mustache-sharp
mustache-sharp copied to clipboard
ConditionTagDefinition
Could we make this class public? It is a useful one to be able to inherit from and add as a custom tag (have tested successfully)
I've done my own #compare (like #if but with operators).
#compare @index 'eq' 0 // Will be true if current index EQuals 0 #compare @index 'ne' 0 // Will be true if current index is Not Equal to 0 #compare @index 'factor' 2 // Will be true if current index is evenly divided by 2 #compare @index 'gt' 0 // Will be true if current index greater than 0 #compare @index 'ge' 1 // Will be true if current index greater than or equal to 1 #compare @index 'lt' 10 // Will be true if current index less than 10 #compare @index 'le' 9 // Will be true if current index less than or equal to 9
Only had to reproduce a minimal amount of code from ConditionTag into it but I agree. If I could have inherited ConditionTagDefinition it'd be cleaner.
Can u please give me a complete example , how you create ur own #compare tag. i also need to do this type of work.