Permalink
Browse files

Added isodd operator

Added an operator that checks if subject is odd or even.
Passes if the subject is an odd integer.
  • Loading branch information...
1 parent e164d52 commit 7673df24f63122120cd89d51ab7065b3fd302919 @mkay committed Feb 22, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 core/components/if/snippet.if.php
@@ -100,6 +100,9 @@
default:
$output = (($subject == $operand) ? $then : (isset($else) ? $else : ''));
break;
+ case 'isodd':
+ $output = (($subject % 2) ? $then : (isset($else) ? $else : ''));
+ break;
}
}
}

0 comments on commit 7673df2

Please sign in to comment.